Question

So I have a .xcconfig file set up and wired to a specific target (there are more targets in the project) in the Project settings on the Info tab in the Configurations pane.

The contents of the .xcconfig file look like this:

//:configuration = AppStore //This is the name of the configuration instead of Release
COPY_PHASE_STRIP = NO
CODE_SIGN_IDENTITY = Somecompany Ltd.
CODE_SIGN_IDENTITY[sdk=iphoneos*] = Somecompany Ltd. 
PROVISIONING_PROFILE[sdk=iphoneos*] = 123456789blablablah
//:completeSettings = none

This kind of works. I see that it replaced the Code Sign Identity in the Project settings, but it did not replace all code signing fields in that specific target's settings where I would like.

This is how it looks like in the project settings: Project settings

And this is how it looks like in the target's settings: enter image description here

The question: How can I specify code sign identity in .xcconfig file by target, or what other way is there to make it work?

Was it helpful?

Solution 2

Turns out the 'code' was right all along. I did not need to add anything to the xcconfig file, it's enough to just wire it to the target on the Info pane.

The problem was that even if there is a "Don't Code Sign" line set for code signing it still counts as something and the setting does not get overwritten. Selecting the line where it says Don't Code Sign and hitting backspace solved the problem!

OTHER TIPS

Just add this to xcconfig.*

PROVISIONING_PROFILE = fea8c55b-1fb4-4f64-9001-a12e998e3fdd

Then go to "Build settings" => "Code signing" => "Provisioning profile" => "Left mouse button click" => Select "Other..." => enter "$(inherited)" => Enjoy!

enter image description here

Please tell me if something doesn't work for you. Hope it helps.

You can use a variable defined in your xcconfig and use it under the target build settings in the way of $(YOUR_VARIABLE).

In order to set it in the project, you must select "Other" from the bottom of the list and them input the statement $(YOUR_VARIABLE).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top