Xcode - how to set different package identifiers for different build configurations?

I have 3 different build configurations configured for my iOS Xcode project. enter image description here

I want to have different package identifiers for different configurations for better code signing control. Below are my general identification settings, information tab settings and package identifier settings in the build settings.

enter image description here

Section INFO -

enter image description here

CONSTRUCTION SETTINGS -

enter image description here

When I update the package identifier directly in the general section, the value in the assembly settings → Product set identifier becomes overridden for all assembly configurations .

Please suggest me the best way to handle this!

+5
source share
1 answer

As far as I can see, you have already set up separate xcconfig files for each configuration. This means that you can simply add the package identifier key with the corresponding value to each assembly configuration file / xcconfig file.

PRODUCT_BUNDLE_IDENTIFIER = com.mycomp.hockey 

You need to make sure that you do not override these xcconfig parameters in the build settings of the Xcode project (the corresponding value should not be in bold).

If you want to switch between your package identifiers on the fly, you may need to create one schema for each build configuration. Thus, you can simply select the appropriate scheme in the Xcode scheme selector (next to the build / run button).

enter image description here

To create a new scheme, simply select New scheme from the New scheme selector and select a name, for example MyApp [Hockey] . Then edit the layout and select your preferred build configuration for each step, for example, MyApp [Hockey] for the Archive step.

enter image description here

You will notice that the packet identifier on the target information screen will change depending on the selected scheme. Sometimes you need to switch to another tab of the parameters of your project, and then return to the "Information" tab before the package identifier changes (one of many Xcode errors).

We use the same approach for all of our projects.

Hope this helps.

+4
source

Source: https://habr.com/ru/post/1258398/


All Articles