我找到了杀死所有模拟器的命令,但不符合我的需求。根据需要,我需要能够重新启动特定的模拟器。
我尝试关机,然后使用以下方式启动模拟器
$ xcrun simctl shutdown <udid>
$ xcrun simctl boot <udid>
$ open -a simulator
但是执行这些命令后模拟器会挂起。
Xcode版本:10.3模拟器版本:iPhone XS iOS:12.4
我正在使用xcode 11.3,但这似乎对我有用:
export UDID=$(xcrun simctl list devices | grep "(Booted)" | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})")
xcrun simctl shutdown $UDID
xcrun simctl boot $UDID
可能值得对其进行更新以更新到最新的xcode。