简体   繁体   English

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

[英]How do I reset the simulator used by an Xcode bot?

The simulator instance I'm using is sometimes left in an inconsistent state after a continuous integration run, how do I reset it? 连续集成运行后,我使用的模拟器实例有时处于不一致状态 ,该如何重置?

It does not seem that resetting the simulator that runs in a normal user account on the build server will reset the simulator that is used by the Bots (which is run under the restricted _xcsbuild user.) 重置在构建服务器上以普通用户帐户运行的模拟器似乎不会重置由Bots使用的模拟器(在受限的_xcsbuild用户下运行)。

Inspired by this gist , run this script as a "Before Integration" trigger on your Bot: 受此要旨启发,请将此脚本作为Bot上的“集成之前”触发器运行:

/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

... and dupe radar 24091918 to add "all" as a valid argument to xcrun simctl shutdown . ...并且欺骗雷达24091918将“全部”添加为xcrun simctl shutdown的有效参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM