Use XCode configurations and schemes to test a mobile app while running the API locally. It’s easy!

Today’s tip occurred to us when we wanted to test an iOS application with the API running locally (by default the app uses a staging server so our mobile developers don’t need to bother with setting up a Rails / Phoenix app).
We wanted to change the API address in app configuration but without overriding the files in the repository.
We found out it’s possible to achieve this by using XCode configurations and schemes.
To create a new scheme you need to click on the name next to the stop button:

images/blog/2017-06-15-xcode-supports-multiple-configurations-developers-notes/image1.png

Select New Scheme and name it. After that, select the new scheme and click edit.
In the new window, select “Run” on the left tab and select the build configuration you would like to use for your new scheme:

images/blog/2017-06-15-xcode-supports-multiple-configurations-developers-notes/image2.png

If you need more configurations, you can define them on the project properties panel. The easiest way to create a new configuration is by duplicating the existing one:

images/blog/2017-06-15-xcode-supports-multiple-configurations-developers-notes/image3.png

Łukasz, our Software Development Team Leader, was happy to share today’s Developers’ Notes. If you enjoy tips and tricks like this one, check in on us soon, because there’ll be more!