使用 Cruise Control 运行 Xcode iPhone 单元测试
当使用 Cruise Control 通过单元测试构建 iPhone XCode 项目时,会生成“代码签名错误:无法找到与应用程序标识符“com.yourcompany.Calculator”匹配的有效配置文件”的错误。通过 XCode 运行时没有遇到这种情况吗? Cruise Control 是否试图启动该应用程序而不仅仅是构建它?有什么建议吗?
When using Cruise Control to build an iPhone XCode project with Unit Tests, an error of "Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.Calculator' could not be found" is generated. This isn't encountered when run through XCode? Is Cruise Control trying to launch the app rather than just build it? Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定
xcodebuild
是否正确运行代码签名工具,但在我看来,您需要更改构建过程才能使用该工具(codesign
)。我不确定这是预构建任务还是构建后任务。
codesign
手册页:http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/codesign.1.html根据此 这篇文章,您可以通过告诉
来解决这个问题xcodebuild
假设目标是 iPhone 模拟器而不是实际的 iPhone(使用-target
命令行选项)I don't know for sure if
xcodebuild
properly runs the code signing tool, but it sounds to me that you'll need to change your build process to use that tool (codesign
).I'm not sure if it's a pre-build or post-build task.
codesign
man page: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/codesign.1.htmlAccording to this this SO post, you may be able to get around this by telling
xcodebuild
to assume the target is the iPhone Simulator instead of the actual iPhone (with the-target
command line option)该问题是由向项目添加单元测试包引起的。为了确保测试与主项目一起构建和运行,我将单元测试目标拖到主项目目标中。
默认情况下,它已分配针对 iPhone 设备 3.1.2 SDK 而不是模拟器构建的单元测试包。
此外,单元测试包有一个自动生成的 .plist 文件,其中包含默认的包标识符 com.yourcompany...等。
因此,尽管指定了一个我知道具有 iPhone Simulator 3.1.2 默认 SDK 的目标,但包含单元测试包导致错误不断出现。
为单元测试包选择“获取信息”,选择“构建”选项卡并将 Base SDK 设置为 iPhone Simulator 3.1.2,一切都会好起来的。
The problem was caused by the addition of the Unit Test Bundle to the project. To ensure that tests were built and run along with the main project, I had dragged the Unit Tests target into the main project Target.
By default, it had assigned the Unit Test Bundle to be built against the iPhone Device 3.1.2 SDK rather than the simulator.
Also, the Unit Test Bundle had an auto-generated .plist file which contained the default Bundle Identifier of com.yourcompany...etc.
So despite specifying a target which I knew had a default SDK of the iPhone Simulator 3.1.2, the inclusion of the Unit Test Bundle caused the error to keep appearing.
Selecting 'Get Info' for the Unit Test bundle, select the Build tab and set the Base SDK to iPhone Simulator 3.1.2 and all will be well.