Jenkins-ios:如何从Jenkins推出iphone模拟器

时间:2014-08-12 07:18:05

标签: ios jenkins

我在构建服务器上使用Jenkins CI作为构建管理工具,我使用以下命令通过Jenkins运行我的单元测试用例。

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/
xcodebuild -sdk iphonesimulator -project MyStore2.xcodeproj -scheme MyStore2 -configuration Debug RUN_APPLICATION_TESTS_WITH_IOS_SIM=YES ONLY_ACTIVE_ARCH=NO clean test 2>&1 | /usr/local/bin/ocunit2junit 

iPhone模拟器不是从Jenkins UI启动的,而如果我在命令提示符下使用相同的命令,它运行正常。

构建控制台输出如下:

/Users/Shared/Jenkins/Home/workspace/iOSUnitTestCaseSample/MyStore2/Images.xcassets
2014-08-12 03:11:38.979 IBCocoaTouchImageCatalogTool[92947:303] CFPreferences: user home directory at file:///Users/Shared/Jenkins/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.
/* com.apple.actool.compilation-results */
/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyStore2-cfjvjlzuxlhdpddpszyhlozlqjdw/Build/Products/Debug-iphonesimulator/MyStore2.app/LaunchImage-700-568h@2x.png
/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyStore2-cfjvjlzuxlhdpddpszyhlozlqjdw/Build/Products/Debug-iphonesimulator/MyStore2.app/Assets.car
/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyStore2-cfjvjlzuxlhdpddpszyhlozlqjdw/Build/Intermediates/MyStore2.build/Debug-iphonesimulator/MyStore2.build/assetcatalog_generated_info.plist

.
.
.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyStore2-cfjvjlzuxlhdpddpszyhlozlqjdw/Build/Products/Debug-iphonesimulator/MyStore2Tests.xctest/MyStore2Tests -o /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyStore2-cfjvjlzuxlhdpddpszyhlozlqjdw/Build/Products/Debug-iphonesimulator/MyStore2Tests.xctest.dSYM

请指导我如何解决此问题。帮助感谢。

感谢。

1 个答案:

答案 0 :(得分:3)

我过去通过在Jenkins奴隶上使用JNLP客户端并让用户登录来解决这个问题。我的理论是如果你通过SSH启动奴隶代理,那么模拟器就没有窗口环境来运行英寸

另一种解决方案是使用ios-sim