How to populate various Info.plists for different configurations in Xcode

I need to fill out various Info.plists for iOS device diagrams and Simulator for the same purpose. How do I achieve this? The problem is this: my voip application so I need to add UIBackgroundModes to Info.plist, but the problem is that when this property exists in plist and I run the Simulator circuit, Simulator just got stuck on the splash screen and I even pressed the "Home" button Does nothing, the console does not show anything. Therefore, I would like to have one plist for the Simulator circuit without UIBackgroundModes, and the second with. I could do this with a shell script, but since the script is the same for both schemes, I don't know how to distinguish them ...

TIA

+4
source share
2 answers

Another solution:

In Xcode 4.3 (and possibly earlier) you can use preprocessors in your Info.plist. That way you can, for example, set UIBackgroundModes to $ {MY_BACKGROUNDMODES}

In the assembly settings, you can define different MY_BACKGROUNDMODES values ​​for each assembly configuration.

+7
source

In the presentation of the project. If you click on any given group, a list of tables will appear at the top of the split of its contents.

The rightmost column is a checkmark that indicates whether the item is included in the target. Configure your debug and plist configuration. Include one plist in the simulation configuration and the other in the configuration of your device.

+1
source

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


All Articles