0

A noob iOS dev question: How do iOS developers develop their app with non prod REST URL endpoints while then using a prod REST URL endpoint for actual use by customers?

I'm not aware of a way you can "toggle" back and forth between prod and non prod URL's when using an app. For our web app dev we deploy a properties file specific to the environment. So the non prod web app points to non prod resources. But with iOS you can only have one deployment to a device. How can you configure that a given device represents non prod and should access non prod resources?

2

Define a scheme for each environment. Each scheme can then override project level build settings as desired. This then opens up several levels of customization.

You can change build settings on a per-scheme basis. For example change the bundle identifier and you can install a copy of the app configured with each scheme on the same device.

You can add values set in scheme build settings to your info.plist file. For example the URL of the server to connect to.

You can add a run script build phase to configure app assets based on scheme configured build settings. For example I usually specify a plist which is then merged with the Info.plist allowing each scheme to configure custom URL schemes, bundle identifiers, and so on. Similarly you might copy or symlink resources into place which are referenced by your build target, allowing you to include only resources relevant to the current scheme in the app bundle (swapping the app icon for example).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.