Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trungnguyen1791/b68bd93ad8ac1391a54168abf16809c5 to your computer and use it in GitHub Desktop.
Save trungnguyen1791/b68bd93ad8ac1391a54168abf16809c5 to your computer and use it in GitHub Desktop.
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@trungnguyen1791
Copy link
Author

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService; xcrun simctl list devices | grep "iPhone|iPad" | awk '{print $(NF -1)}' | cut -d "(" -f2 | cut -d ")" -f1 | grep -E "^[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}$" | xargs -I {} xcrun simctl erase "{}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment