xcode 使用命令行 xcodebuild 指定 PROVISIONING_PROFILE 时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8348684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error specifying PROVISIONING_PROFILE using command line xcodebuild
提问by Alfie Hanssen
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.
我无法使用我通过命令行指定的代码签名标识和配置文件覆盖在 Xcode 构建设置中指定的配置文件。
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".
如果 Xcode Build Settings 设置为“dont code sign”,这将完美运行。但是,如果它设置的身份不是我指定为 DEVELOPER 的身份,它就会失败。请注意,我不想打开 Xcode 来使用此脚本生成构建。但我目前必须确保构建设置显示“不要编码签名”。
I think I need to find a way to also specify the provisioning profile via xcodebuild but when I write:
我想我需要找到一种方法来也通过 xcodebuild 指定配置文件,但是当我写:
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.
该命令失败并表示无法找到配置文件。即使它在正确的位置。我试过指定完整路径,相对路径,只是文件名。当我在 xcrun 命令中指定此配置文件时,它会起作用。但这对 xcodebuild 来说是行不通的。
Any ideas?
有任何想法吗?
回答by too_early
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:
不确定您是否找到了答案,但我是这样发现的:本地(到您的机器)配置文件有一个唯一标识符,您可以将其传递给 PROVISIONING_PROFILE 设置。如果您打开 XCode,在“代码签名”(在构建设置中)下选择您的代码签名,您可以找到此字符串。在代码签名弹出窗口中选择您的代码签名值(与您的配置文件相关联)后,如果您选择“其他...”,它将显示如下内容:
iPhone Distribution: ABCDEFJ-1234-5678-A382-ABDEWKEKEKE
iPhone 分发: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.
如果您将第二行('ABCD ...')放入 XCode 中的 PROVISIONING_PROFILE 命令中,它应该可以工作。不过,我假设如果您更新了您的配置文件,您将需要确保确定该值并更新您传递给 Xcode 的内容。