Created
July 15, 2015 07:28
-
-
Save NicholasTD07/25e81bbe91c8b5c1e91b to your computer and use it in GitHub Desktop.
Clean up ghost iOS simulators in `xcrun simctl`
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
#!/bin/sh | |
# I was having ghost devices in my iOS Simulator. | |
# There were multiple device for one device type, one OS. | |
# For example, there were at least 4-5 devices for iPhone 6, OS 8.4 | |
# USE IT AT YOUR OWN RISK | |
devices=(`xcrun simctl list devices | grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1`) | |
for device in $devices; do | |
xcrun simctl boot $device 1>/dev/null 2>&1 || xcrun simctl delete $device && xcrun simctl shutdown $device | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment