I'm working on an app right now and we're trying to get some testing done against the staging environment as well as the production environment. Naturally, I've created "Stage" and "Prod" build configurations to switch between the two, but my client would like to have the two installed side by side so they could switch between the two environments easily. I've been doing this so far by maintaining a branch of my code with a different bundle identifier and bundle display name, so they can be installed and tested side by side. I'm beginning to wonder if there may be an easier way to do this, though. Is there a way I could define a custom build setting, give it a value based on the build configuration, and then append that to the end of the bundle identifier?
Something like...
BUNDLE_SUFFIX TEST STAGE PROD ".PROD"
...and then set my Bundle Identifier to com.blah.blah$(BUNDLE_SUFFIX)
. Then all builds with the PROD config will automatically get the new bundle id and I won't have to synchronize branches all the time. Is that kind of thing even possible?
The ending should be some variant of your app's name for readability. (It can actually be whatever you want, as long as all of your apps have different ones.)
Under Targets > Build settings, scroll to Packaging. Change your Product name to the desired name & Product bundle identifier to the new one. Once you do this, automatically your project display name & bundle id changes to the new one in General tab.
In Xcode 7:
this can be done easily using the packaging configuration in build setting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With