I'm a little confused how this works - this is my understanding:
But... bundle ID is also located in Info.plist. It seems that if you change the bundle ID in Info.plist, Xcode changes it automatically in Target info\Properties\Identifier, and vice versa.
So which is it that takes precedence? The Target info\Properties\Identifier bundle ID or the Info.plist bundle ID?
The reason I ask is because I'd like to have two versions for my app - a free ad supported version and a paid version, and I'd like to accomplish that with two different targets. Since they will be two different apps in the App Store, my understanding is they need two different app IDs (and I don't want to go down the * route with app IDs, the description of how that works on the App Store made my brain hurt).
Would I need two different Info.plists for each target if I did this, or can I use the same Info.plist, and just have the different targets use a different development/distribution provisioning profile?
Change the Bundle IDChoose your project from the left side, then your app target under TARGETS, select the General tab and rename the Bundle Identifier.
An App ID is a string used to identify one or more apps from a single development team. The string consists of two parts, the Team ID and the bundle ID separated by a period (.). The Team ID is supplied by Apple, while the bundle ID is supplied by the developer.
You can modify the bundle identfier in ProjectSettings. asset that way: Edit > Project Settings > Player > Android > Other Settings > Package Name. You might want to change it for all platforms since this field is separate by each platform. ProjectSettings.
A target specifies a product to build, such as an app, framework, app extension, or unit test. A project can contain multiple targets, usually representing related parts of a single product. For example, a project might contain separate targets for an app, a private framework, an app extension, and a suite of tests.
There isn't a precedence, the properties dialog is just serving as another way for you to see your Info.plist.
To share the plist between the targets but have different identifiers, make sure that the "Expand Build Settings in Info.plist File" option is enabled for both targets. Then, for each target, make a new user-created variable in the target settings for your bundle ID (e.g., APPLICATION_BUNDLE_IDENTIFIER, see here: https://stackoverflow.com/a/18472235/308315) and set it to the right value for that target. In your plist, put the following for bundle ID:
<key>CFBundleIdentifier</key>
<string>$(APPLICATION_BUNDLE_IDENTIFIER)</string>
The variable will be evaluated at build time for each target, so each will get the right bundle ID.
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