Last active
December 24, 2015 20:29
-
-
Save christoph-jerolimov/6858302 to your computer and use it in GitHub Desktop.
Kill iPhone Simulator. First friendly, afterwards not so friendly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ! pgrep "iPhone Simulator"; then | |
exit 0; | |
fi | |
pids=$(pgrep "iPhone Simulator") | |
osascript -e 'tell app "iPhone Simulator" to quit' | |
sleep 1 | |
for pid in $pids; do | |
if ps $pid; then | |
sleep 4 | |
kill $pid | |
sleep 1 | |
fi | |
if ps $pid; then | |
sleep 4 | |
killall -9 $pid | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment