是否有任何选项可以重置所有模拟器的内容和设置?在单个事件或通过命令行的单个命令中?
最佳答案
根据 Jeremy Huddleston Sequoia 的回答,我编写了一个 shell 脚本来重置所有模拟器。
对于Xcode 7,您可以使用:
#!/bin/sh
instruments -s devices \
| grep "(\d[.0-9]\+) \[[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}\]" \
| grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" \
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
对于以前的版本,请使用:
#!/bin/sh
instruments -s devices \
| grep Simulator \
| grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" \
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
关于iphone - 重置所有 iOS 模拟器的内容和设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15365179/