Skip to content

Instantly share code, notes, and snippets.

@mattio
Last active October 5, 2019 13:13
Show Gist options
  • Save mattio/63d9f9958470f2c423b18985ef48e952 to your computer and use it in GitHub Desktop.
Save mattio/63d9f9958470f2c423b18985ef48e952 to your computer and use it in GitHub Desktop.
Shutdown and erase all Xcode simulators then re-open your default preference so it's ready to go.
#!/bin/bash
echo "Shutting down all devices..."
$(xcrun simctl shutdown all)
echo "Erasing all devices..."
$(xcrun simctl erase all)
echo "Quitting Simulator.app..."
$(osascript -e 'quit app "Simulator"')
echo "Re-opening your default simulator..."
# xcrun simctl list devices to get a list
$(xcrun simctl boot 4BB9C625-F60B-4A44-9AEC-F1E6B0FE1CED)
$(open -a Simulator.app)
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment