如何重置Xcode机器人使用的模拟器?

时间:2016-01-07 17:46:19

标签: xcode ios-simulator xcode-bots

我正在使用的模拟器实例有时会在持续集成运行后保留在inconsistent state中,如何重置它?

重置在构建服务器上的普通用户帐户中运行的模拟器似乎不会重置Bots使用的模拟器(在受限制的_xcsbuild用户下运行。)

1 个答案:

答案 0 :(得分:2)

this gist的启发,将此脚本作为Bot上的“Before Integration”触发器运行:

/usr/bin/osascript -e 'tell application "iOS Simulator" to quit'
/usr/bin/osascript -e 'tell application "Simulator" to quit'
/usr/bin/xcrun simctl erase all

...和重复雷达24091918将“all”添加为xcrun simctl shutdown的有效参数。