Signing app with xcodebuild command line with PROVISIONING_PROFILE fails

谁说胖子不能爱 提交于 2019-12-06 02:32:47

问题


I trying to sign my app command line using Xcode.

Running xcodebuild command-line on MyApp.xcodeproj like so:

xcodebuild -project "MyApp.xcodeproj" -target "MyApp" -sdk "iphoneos" -configuration *Release* PROVISIONING_PROFILE="xxxx-xxxx-xxxx-xxxx" CODE_SIGN_IDENTITY="iPhone Developer: something.com (SOMEVALUE)"

Gives following error:

Check dependencies
Provisioning profile "iOS Team Provisioning Profile: *" doesn't include signing certificate "iPhone Developer: something.com (SOMEVALUE)".
Provisioning profile "iOS Team Provisioning Profile: *" is Xcode managed, but signing settings require a manually managed profile.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'

** BUILD FAILED **

What is wrong ? What is missing in my xcodebuild command ?

How can I include the signing certificate that its asking about ?

What I tried from answer & comments below
As I understand, a dedicated distribution profile should be used with Release build. That is present in the system. I just need to know how to use it with xcodebuild command for manual signing if I can.

Executing security find-identity -p codesigning -v | grep "$CODE_SIGN_IDENTITY" gives a list of 5 signing identities ones of them clearly states as iPhone Distribution: My Company (SOME123ID).

*So, can I use the distribution profile with xcodebuild manual signing? If yes, How can I get the actual ID of a distribution profile to use with xcodebuild command?


回答1:


Using PROVISIONING_PROFILE is deprecated since Xcode8. Try PROVISIONING_PROFILE_SPECIFIER instead. PROVISIONING_PROFILE_SPECIFIER="Human Readable Prov Profile Name"

It may also be necessary to turn off Xcode's Automatic Signing:

Xcode9: simply append CODE_SIGN_STYLE="Manual" to your xcodebuild command

Xcode8: sed -i '' 's/ProvisioningStyle = Automatic;/ProvisioningStyle = Manual;/' TestApp/TestApp.xcodeproj/project.pbxproj && xcodebuild ...

You can check your Xcode Version on the command-line with xcodebuild -version



来源:https://stackoverflow.com/questions/45051712/signing-app-with-xcodebuild-command-line-with-provisioning-profile-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!