使用带有PROVISIONING_PROFILE的xcodebuild命令行签名应用程序失败

Gam*_*ads 5 xcode xcodebuild provisioning-profile ios-provisioning

我尝试使用Xcode签署我的app命令行.

像这样运行xcodebuild命令行:MyApp.xcodeproj

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

给出以下错误:

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 **
Run Code Online (Sandbox Code Playgroud)

怎么了 ?我的xcodebuild命令缺少什么?

如何包含其询问的签名证书?

我从下面的回答和评论中尝试了什么
据我所知,一个专用distribution profile应该与Release版本一起使用.这存在于系统中.xcodebuild如果可以的话,我只需要知道如何使用命令进行手动签名.

执行security find-identity -p codesigning -v | grep "$CODE_SIGN_IDENTITY"给出了5个签名身份的列表,其中一个明确表示为iPhone Distribution: My Company (SOME123ID).

*那么,我可以使用xcodebuild手动签名的分发配置文件吗?如果是,我如何获得与xcodebuild命令一起使用的分发配置文件的实际ID?

Sve*_*ker 10

使用PROVISIONING_PROFILE自Xcode8已被弃用.试试吧PROVISIONING_PROFILE_SPECIFIER.PROVISIONING_PROFILE_SPECIFIER="Human Readable Prov Profile Name"

可能还需要关闭Xcode的自动签名:

Xcode9:只需附加CODE_SIGN_STYLE="Manual"到xcodebuild命令即可

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

您可以在命令行上检查Xcode版本 xcodebuild -version

  • 您可以在调用 xcodebuild 时覆盖任何构建设置,因此您当然可以执行 DEVELOPMENT_TEAM="ABCDEFGH"(应为 10 个字符,请参阅您的 prov 个人资料中的 `<key>com.apple.developer.team-identifier</key>`) (2认同)
  • 是否可以通过这种方式提供多个配置文件(以防您需要构建多个配置文件的应用扩展)? (2认同)