xcodebuild 的 CODE_SIGN_IDENTITY 参数 (Xcode 4)
我正在使用 Xcode 3 附带的 xcodebuild
实用程序来自动执行 Hudson 下的构建。该命令如下所示:
xcodebuild -project Project.xcodeproj -target Target -configuration Release -sdk iphoneos CODE_SIGN_IDENTITY[sdk=iphoneos*]="iPhone Distribution:XXXXXX"
我尝试对 Xcode 4 使用相同的命令,但似乎 xcodebuild
只是忽略 CODE_SIGN_IDENTITY
参数并使用配置文件进行签名,该配置文件是在 Xcode 中为目标选择。
这对我来说非常重要,因为我必须使用 3-4 个不同的配置文件来签署构建。它在 Xcode 3 上工作正常,但在 Xcode 4 上不起作用。
知道如何解决这个问题吗?
I'm using xcodebuild
utility shipped with Xcode 3 to automate my builds under Hudson. The command looks like it follows:
xcodebuild -project Project.xcodeproj -target Target -configuration Release -sdk iphoneos CODE_SIGN_IDENTITY[sdk=iphoneos*]="iPhone Distribution:XXXXXX"
I'm trying to use the same command for Xcode 4 but it seems that xcodebuild
just ignores CODE_SIGN_IDENTITY
parameter and signs with the provisioning profile which is selected for the target in Xcode.
It's a quite crucial for me since I have to sign build with 3-4 different profiles. It works OK with Xcode 3 but doesn't work with Xcode 4.
Any idea how to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
较新的 xcodebuild 现在允许指定设置。
取自 developer.apple.com< /a>:
我还找到了这个资源来解释 可用设置
但是,索引中缺少 PROVISIONING_PROFILE可用命令。
我最终使用的命令指定了“CODE_SIGN_IDENTITY”& “PROVISIONING_PROFILE”设置。
A newer xcodebuild now allows settings to be specified.
Taken from developer.apple.com:
I also found this resource for explaining the available settings
However, PROVISIONING_PROFILE is missing from the index of available commands.
The command I finally used specified "CODE_SIGN_IDENTITY" & "PROVISIONING_PROFILE" settings.
我遇到了以下问题:
我们的开发人员使用“iPhone Development”签名身份,但我需要为我们的自动化集成系统使用“iPhone Distribution”签名身份。
添加了这一行:以交换代码签名身份(请参阅
-f
标志)。因此,我在
xcodebuild
和xcrun
命令之间I had following problem:
Our developers used the 'iPhone Development' signing identity, but I needed to use the 'iPhone Distribution' signing identity for our automated integration system.
So I added the line:
between the
xcodebuild
and thexcrun
commands to swap the code signing identities (see the-f
flag).据我所知,Xcode 4 中的签名是通过 xcrun 工具完成的:
使用起来有点不舒服,因为您必须同时指定您的身份和 mobileprovisioning 文件。如果您使用
~/Library/MobileDevice/Provisioning Profiles/
目录中的最后一个,则尤其不舒服,因为每次从 Provisioning Portal 自动更新配置文件时,其名称都会更改。As far as I know in Xcode 4 signing is done with
xcrun
tool:It is a bit uncomfortable to use because you must specify both your identity and mobileprovisioning file. Especially uncomfortable if you use last one from
~/Library/MobileDevice/Provisioning Profiles/
directory because its name is changed every time provisioning profiles are updated automatically from Provisioning Portal.只需将 CODE_SIGN_IDENTITY="iPhone Distribution:XXXXXX" 与 Xcode 4 一起使用(不带 [sdk=iphoneos*])
Just use CODE_SIGN_IDENTITY="iPhone Distribution:XXXXXX" with Xcode 4 (without [sdk=iphoneos*])
我找到了使用詹金斯构建的一个很好的解决方法。
首先,在设置作业之前,下载一个名为:
Parameterized Trigger Plugin
的 jenkins 插件https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin
完成此操作后,创建作业,并在创建作业时选择
“此构建是参数化'复选框
创建字符串参数。我将我的称为 CODE_SIGN_IDENTITY。
因此,字符串参数中的名称字段应为:
名称:CODE_SIGN_IDENTITY
默认值:iPhone 开发人员:XXX XXXXXX
描述:无论您想放在那里
然后在您的 Xcode 插件中,找到“自定义 xcodebuild 参数”字段。
在“自定义 xcodebuild 参数”字段中,输入以下值:
CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}
完成作业设置,您应该已准备就绪!
这将绕过空白问题。该插件是一个救星,因为它工作得非常好,您可以使用其他参数自定义您的构建。
I found a great workaround for building with jenkins.
Firstly, before setting up a job, download a jenkins plugin called:
Parameterized Trigger Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin
Once you do that, create your job and while creating the job, select the
'This build is parameterized' checkbox
Create a String Parameter. I call mine CODE_SIGN_IDENTITY.
So the name field in the String Parameter should be:
Name: CODE_SIGN_IDENTITY
Default Value: iPhone Developer: XXX XXXXX
Description: Whatever you want to put there
Then in your Xcode Plugin, find the 'Custom xcodebuild arguments' field.
In the Custom xcodebuild arguments field, place the following value:
CODE_SIGN_IDENTITY=${CODE_SIGN_IDENTITY}
Finish setting up your job and you should be all set!
This will bypass the white space issue. The plugin is a life saver as it works wonderfully and you can customize your build with other parameters.