Thursday, January 2, 2014

Shortcut to "kill" the iOS Simulator

Sometimes Xcode just can't make the iOS Simulator fully quit. Opening a terminal and typing commands to kill the iOS Simulator can take time to get used to. This is why I associated a shortcut key for killing the simulator using a bash script.

Here's a quick guide for creating achieving this:

1. Install Better Touch Tool (you can download it here:
2. Open preferences window
3. Follow the steps on the picture and paste this piece of code:
killall -s "iPhone Simulator" &> /dev/null
if [ $? -eq 0 ]; then
    killall -m -KILL "iPhone Simulator"

4. Press the selected keyboard shortcut and watch the iOS Simulator disappear.