Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different Bundle Identifier for different build configurations

Tags:

xcode

ios

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?

like image 806
Jose Ibanez Avatar asked Jun 25 '12 23:06

Jose Ibanez


People also ask

What should my bundle identifier be?

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.)

How do I change my product bundle identifier?

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.


1 Answers

In Xcode 7:

this can be done easily using the packaging configuration in build setting

enter image description here

like image 118
anoop4real Avatar answered Sep 23 '22 10:09

anoop4real