本文介绍了使用带有 PROVISIONING_PROFILE 的 xcodebuild 命令行签署应用程序失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 Xcode 对我的应用命令行进行签名.

I trying to sign my app command line using Xcode.

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

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)"

出现以下错误:

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 **

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

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

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

我从 answer &下面的评论
据我所知,一个专用的 distribution profile 应该与 Release 版本一起使用.那是存在于系统中的.如果可以,我只需要知道如何将它与 xcodebuild 命令一起用于手动签名.

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.

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

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).

*那么,我可以使用带有 xcodebuild 手动签名的分发配置文件吗?如果是,我怎样才能获得用于 xcodebuild 命令的分发配置文件的实际 ID?

推荐答案

使用 PROVISIONING_PROFILE 自 Xcode8 起已弃用.改为尝试 PROVISIONING_PROFILE_SPECIFIER.PROVISIONING_PROFILE_SPECIFIER="人类可读证明配置文件名称"

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

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

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

Xcode9:只需将 CODE_SIGN_STYLE="Manual" 附加到您的 xcodebuild 命令

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 ...

您可以使用 xcodebuild -version

这篇关于使用带有 PROVISIONING_PROFILE 的 xcodebuild 命令行签署应用程序失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 10:01