简体   繁体   中英

Xcode 4 UI builds app fine but commandline xcodebuilder fails on code signing

Our iOS application will not build successfully from the command 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?

现在,您可以使用xcodebuilder指定要使用的配置文件

xcodebuilder -target YOUR_TARGET PROVISIONING_PROFILE="YOUR_PROVISIONING_PROFILE"

I was able to fix this issue by performing the following 4 steps:

  1. I logged into the root user account and added the team agent's private key to the root user's keychain.
  2. 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.
  3. 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.
  4. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM