Why are there Code Signing Build settings for the project and the target and which takes preference?
I have 2 targets – one for Lite and one for Premium version. When creating ad hoc builds I am confused as to why one can edit code signing build setting in 2 places and which takes preference?
Target build settings, if defined, always override Project settings. You can tell if these are defined because they are bold.
Depending on the purpose of your different Targets, they may need a few different settings, or many. To create an extreme example, imagine you have Mac OS-based editor for your iOS game in the same Project. The two Targets would have different architectures, SDKs, search paths, memory management, etc.
Or, if your Targets are Lite and Premium versions of the same app, almost nothing should change between them.
If you find yourself changing a setting in all your Targets, you should change that setting in the Project instead. You can cancel an override in the Target by selecting one of those bold Build Settings and pressing the delete key. This can’t be undone, so make sure you know what the setting was if you need to delete it.
In the case of code signing, have the code signing in the Project alone.
If you ended up licensing a custom version of your app to a different company, you would need to have a new Target with different code signing, so it’s nice that XCode can do this if you need it.