Is there any option to reset the contents and settings of all the simulators ?In a single event or a single command via command line?
Based on the the answer from Jeremy Huddleston Sequoia I wrote a shell script that will reset all simulators.
For Xcode 7 you can use:
#!/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
For previous versions use:
#!/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
With Xcode 6, you can use the simctl command line utility:
xcrun simctl erase <device UDID>
With Xcode 7, you can erase all at once with:
xcrun simctl erase all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With