I'm having trouble overriding the Code Signing Identity and provisioning profile that are specified in Xcode Build Settings with one that I specify via the command line.
I'm currently doing:
xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}"
If Xcode Build Settings is set to "dont code sign", this works perfectly. But if it's set to an identity other than the one I'm specifying as DEVELOPER, it fails. Note that I do not want to have to open Xcode to produce a build with this script. But I currently have to make sure Build Settings says "don't code sign".
I think I need to find a way to also specify the provisioning profile via xcodebuild but when I write:
xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}" PROVISIONING_PROFILE="#{PROFILE}"
The command fails and says the provisioning profile cant be found. Even though it's in the proper place. I've tried specifying the full path, relative path, just the filename. It works when I specify this profile in the xcrun command. But it's a no go with xcodebuild.
Any ideas?
Not sure if you found the answer but I found out this way: there's a unique identifier for the local (to your machine) provisioning profile, which you can pass in to the PROVISIONING_PROFILE setting. You can find this string if you open up XCode, select your code sign under "Code Signing" (in build settings). After you select your code signing value (associated with your provisioning profile) n the code signing pop-up, if you select "Other..." it will show something like:
iPhone Distribution: ABCDEFJ-1234-5678-A382-ABDEWKEKEKE
If you take that second line ('ABCD...') and put that in to your PROVISIONING_PROFILE command in XCode, it should work. I'm assuming, though, that if you ever update your provisioning profile you'll need to make sure to determine that value and update what you pass in to Xcode.
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