Sorry for this being slightly off topic but in general I would not recommend spinning up a local instance of your backend for testing unless you have a really well structured way of easily spinning up an environment, for instance using docker. It is definitely possible but from my experience it will be a pain to maintain down the road when both the app and the backend grows in complexity and thus not worth it in the end.
Instead I recommend using a simple mock server to mock the API responses of your backend. This can be done only by adding some dependencies to your iOS app when running tests.
You can get some inspiration here:
On top of that if you wanna look into making a contract between what the app expects and what the API provides I recommend looking at Pact. You can make the app create a contract for the various endpoints that it depends on and have the backend verify that it fulfils this contract. https://docs.pact.io