看起来Teamcity代理(TC版本是9.0EAP)无法通过测试外壳脚本运行iOS Simulator。
我使用的是Build Step: Command Line,它运行Custom Script并将参数传递给它。Teamcity代理通过使用外壳脚本../bin/mac.launchd.sh在Mac Yosemite10.10上启动。
生成日志中的错误:
[12:33:24][Step 2/2] 2014-11-20 11:33:25.421 xcodebuild[28083:289783] iPhoneSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1.
[12:33:24][Step 2/2]
[12:33:24][Step 2/2] Testing failed:
[12:33:24][Step 2/2] Test target app-tests encountered an error (Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/folders/sz/1lfcb1354xggcnd04_9j5kc40000gp/T/com.apple.dt.XCTest-status/Session-2014-11-20_11:31:25-P1Pjwd.log)
[12:33:24][Step 2/2] ** TEST FAILED **我的用于测试的shell脚本:
xcodebuild \
-sdk iphonesimulator8.1 \
-destination "name=iPad Air,OS=8.1" \
-configuration Debug \
-project "$PROJECTPATH" \
-scheme app-tests \
CONFIGURATION_BUILD_DIR="$BUILDPATH" \
clean test \
| xcpretty -tc -r junit --output "$BUILDPATH/junit.xml"我也尝试了这个question的解决方案,但它对我没有帮助。
发布于 2015-03-26 04:43:25
这个问题已经在评论中得到了回答,这里还有一个苹果论坛的链接来讨论它,AFAIK,它仍然是这样的情况,除非苹果改变它
发布于 2021-12-01 15:51:46
如果有人仍然面临此错误,您可以使用simulatorStartupTimeout在功能中设置所需的超时。
在java中:
DesiredCapabilities caps = new DesiredCapabilities();
...
caps.setCapability("simulatorStartupTimeout", 5 * 60 * 1000); // 5mn
...请参阅https://github.com/appium/appium-xcuitest-driver#simulator
发布于 2016-01-06 03:54:16
您的自定义脚本可能会花费太长时间才能完成。我在构建阶段添加了一个自定义脚本,让它休眠5000秒,从而复制了这个问题。
https://stackoverflow.com/questions/27035637
复制相似问题