Xcode 4 UI builds app fine but commandline xcodebuilder fails on code signing
Our iOS application will not build successfully from the command 开发者_Python百科line using xcodebuilder version 4 but has no issues when building from the Xcode 4 UI.
The command line throws the following error about not finding the provisioning profile:
=== BUILD NATIVE TARGET Calc OF PROJECT iPhoneUnitTests WITH CONFIGURATION Release ===
Check dependencies
[BEROR]Code Sign error: Provisioning profile '0E49F817-DC28-4907-BB73-4E2A02745822' can't be found
** BUILD FAILED **
I checked my local Mobile Provisions folder for that profile and it was present. I even tried specifying the provision profile as an xcodebuilder argument but it still threw the same error.
Any ideas?
I was able to fix this issue by performing the following 4 steps:
- I logged into the root user account and added the team agent's private key to the root user's keychain.
- After the private key was loaded I also downloaded the team agent's developer certificate and loaded it into Xcode by double clicking on it.
- Once I was within Xcode's management console I clicked refresh and entered the team agent's ADC login credentials which caused Xcode to download the appropriate distribution provisioning profiles to the root user account.
- I manually modified the release configuration within project.pbxproj to point to the provisioning profile that was downloaded by Xcode in the previous step.
Even though I logged into the root account first, the problem may have been solved if I had just removed all provisioning profiles and certificates from my local account and then continued from step 2 above.
Using xcodebuilder
you can now specify which provisioning profile to use
xcodebuilder -target YOUR_TARGET PROVISIONING_PROFILE="YOUR_PROVISIONING_PROFILE"
精彩评论