使用命令行 xcodebuild 指定 PROVISIONING_PROFILE 时出错

发布于 12-19 03:11 字数 690 浏览 3 评论 0原文

我无法使用我通过命令行指定的内容来覆盖 Xcode 构建设置中指定的代码签名身份和配置文件。

我目前正在做:

xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}"

如果 Xcode 构建设置设置为“不进行代码签名”,则效果非常好。但是,如果它设置为除我指定为 DEVELOPER 之外的身份,则会失败。请注意,我不想打开 Xcode 来使用此脚本生成构建。但我目前必须确保构建设置显示“不要编码签名”。

我想我需要找到一种方法来通过 xcodebuild 指定配置文件,但是当我编写时:

xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}" PROVISIONING_PROFILE="#{PROFILE}"

该命令失败并表示无法找到配置文件。尽管它在正确的地方。我尝试指定完整路径、相对路径、仅文件名。当我在 xcrun 命令中指定此配置文件时,它会起作用。但这是 xcodebuild 不行的。

有什么想法吗?

I'm having trouble overriding the Code Signing Identity and provisioning profile that are specified in Xcode Build Settings with one that I specify via the command line.

I'm currently doing:

xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}"

If Xcode Build Settings is set to "dont code sign", this works perfectly. But if it's set to an identity other than the one I'm specifying as DEVELOPER, it fails. Note that I do not want to have to open Xcode to produce a build with this script. But I currently have to make sure Build Settings says "don't code sign".

I think I need to find a way to also specify the provisioning profile via xcodebuild but when I write:

xcodebuild -target "#{XTARGET}" -sdk iphoneos#{SDK_VERSION} -configuration #{config} CODE_SIGN_IDENTITY="#{DEVELOPER}" PROVISIONING_PROFILE="#{PROFILE}"

The command fails and says the provisioning profile cant be found. Even though it's in the proper place. I've tried specifying the full path, relative path, just the filename. It works when I specify this profile in the xcrun command. But it's a no go with xcodebuild.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

将军与妓2024-12-26 03:11:14

不确定您是否找到了答案,但我是这样发现的:本地(到您的计算机)配置配置文件有一个唯一标识符,您可以将其传递到 PROVISIONING_PROFILE 设置。如果您打开 XCode,在“代码签名”下(在构建设置中)选择您的代码签名,则可以找到此字符串。在代码签名弹出窗口中选择代码签名值(与您的配置文件关联)后,如果您选择“其他...”,它将显示如下内容:

iPhone Distribution:
ABCDEFJ-1234-5678-A382-ABDEWKEKEKE

如果您将第二行('ABCD...')放入 XCode 中的 PROVISIONING_PROFILE 命令中,它应该可以工作。不过,我假设,如果您更新了配置文件,您需要确保确定该值并更新您传递给 Xcode 的内容。

Not sure if you found the answer but I found out this way: there's a unique identifier for the local (to your machine) provisioning profile, which you can pass in to the PROVISIONING_PROFILE setting. You can find this string if you open up XCode, select your code sign under "Code Signing" (in build settings). After you select your code signing value (associated with your provisioning profile) n the code signing pop-up, if you select "Other..." it will show something like:

iPhone Distribution:
ABCDEFJ-1234-5678-A382-ABDEWKEKEKE

If you take that second line ('ABCD...') and put that in to your PROVISIONING_PROFILE command in XCode, it should work. I'm assuming, though, that if you ever update your provisioning profile you'll need to make sure to determine that value and update what you pass in to Xcode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文