注意:Xcode 7 中的设备名称已更改,因此您不再使用指定它们iPhone 5 (9.1 Simulator)
反而iPhone 5 (9.1)
.
Use xcrun instruments -s
获取当前的设备列表,然后您可以使用以下命令预启动它:
xcrun instruments -w "iPhone 5 (9.1)" || echo "(Pre)Launched the simulator."
预发布
我已经到了我在那里提出的建议不再起作用的地步。除了进行此处提到的更改之外,您还需要启动 xcodebuild 所期望的模拟器BEFORExcodebuild 运行:
# First get the UDID you need
xcrun instruments -s
# Then launch it
open -a "iOS Simulator" --args -CurrentDeviceUDID <sim device UDID>
# and wait some time....
sleep 5
# Then launch your unit tests
xcodebuild [...] -destination 'platform=iOS Simulator,name=<device name matching the UDID>'
Old post
此错误在 Xcode 6.3 及更高版本中已修复。如果您在较新的 Xcode 中遇到类似的问题,这可能是另一个错误。
Apple 针对 Bug ID# 18001199 的后续行动:
LaunchDaemons 提供的上下文不支持运行 GUI
应用程序。 SSH 服务和 Jenkins 的默认设置是
两者都作为 LaunchDaemons 实现。在 Xcode 5 的早期版本中
xcodebuild 可以在这种情况下在 iOS 模拟器上运行测试,但是
这从来都不是受支持的配置,正如您所注意到的
从 Xcode 6 开始不再工作。
与 LaunchDaemons 不同,LaunchAgents 提供了一个可以运行的上下文
GUI 应用程序 - 如果用户当时登录,会出现一个窗口
服务器/Aqua 会话。将您的 Jenkins 配置从
从 LaunchDaemon 变为 LaunchAgent 将避免报告的情况
问题。您还可以使用 launchd 在 iOS 模拟器上运行测试
从 SSH 会话,通过制作 LaunchAgent 并手动
加载/启动它,或者使用“launchctl Submit”。
好吧,在对这里的评论进行了更多挖掘之后(非常感谢Opal https://stackoverflow.com/questions/25380365/timeout-when-running-xcodebuild-tests-under-xcode-6-via-ssh/25418726#comment39579945_25380365),我发现通过 JNLP 启动从站是可行的。
正如许多人提到的,目前无法通过 SSH 运行单元测试,因此您可能想暂时转向 JNLP 代理,直到 Apple 修复它。
如果连接JNLP仍然无法解决,请尝试这里提到的解决方案comment https://github.com/calabash/calabash-ios/issues/251#issuecomment-45476718.
即:在命令行上运行这些:
DevToolsSecurity - 启用
须藤 DSCL 。 -append /Groups/_developer GroupMembership “运行 sim 的用户”
安全authorizationdb写入system.privilege.taskport是-开发者
参见参考资料here https://github.com/calabash/calabash-ios/issues/203#issuecomment-24946939 and here https://github.com/calabash/calabash-ios/issues/251#issuecomment-45476718.
我最近发现如果你安装了新版本的 Xcode 并且不启动它。模拟器可能会再次开始超时。为了解决这个问题,我必须手动启动 Xcode,并安装它所需的附加工具。