Question

I am developing an iPhone app and would like to deploy and maintain two versions of the same app on one phone.

I was looking around and couldn't find a solution here, neither searching the web.

In my apple developer account I have 1 app id like com.xyz.* and in xCode I change the bundle identifier in Build Settings/Product name. On developer.apple.com I couldn't find a way how to manage those apps. Every time I try to run the app with the modified name I get: Xcode cannot run using the selected device.

Is there a best practice? What am I overlooking?

I am using: iOs 7.1 xCode 5.1

Was it helpful?

Solution

So I think what your looking for is having multiple build configurations for the same app. If so this blog covers it very well http://swwritings.com/post/2013-05-20-concurrent-debug-beta-app-store-builds. The University of Google has a lot of additional info on this. I'll try to summarize.

Basically what you will need to do is create 1 provisioning profile for each app (or a wildcard should work as well but that's another rabbit hole). So for example com.your-domain.yourapp.staging and com.your-domain.yourapp.preview.

Then you create a new schemed for each new config you want. Do this under the info tab of your project file.

Then you define some variables in your projects target under 'user-defined' for each one. I declare one called ENV_BUNDLE_DISPLAY_NAME and another called ENV_BUNDLE_IDENTIFIER. For the values of the ENV_BUNDLE_IDENTIFIER I use the bundle id for the provisioning profiles I created earlier.

Lastly you edit your App-Info.plist to use the variables you just declared. So for the field Bundle identifier I set it to $(ENV_BUNDLE_IDENTIFIER) and for bundle display name I set $(ENV_BUNDLE_DISPLAY_NAME)

Lastly when you build, run, or archive you'll need to edit the scheme to use the correct build configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top