How can I reset the iOS Simulator from the command line?

ios, simulator, workflow

Solution

Just run this in the terminal:

xcrun simctl shutdown all && xcrun simctl erase all

Another approach suggested by @txulu, before erasing the simulator kill the process:

killall "Simulator" 2> /dev/null; xcrun simctl erase all

Problem

I need to reset the iPhone Simulator a lot, and haven't found a way to do it without using the mouse. It's a small thing, but I'm really sick of doing it and would love to have a way to do this using a keyboard shortcut. Even better would be a way to reset it from the command line, so I could build a reset into a deploy script. I am not very familiar with iOS or MacOS.

Original source

Related problems