问题
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