Skip to content

Instantly share code, notes, and snippets.

@dr2050
Created April 17, 2018 21:12
Show Gist options
  • Save dr2050/579db399356f447f862fb6565686ffcc to your computer and use it in GitHub Desktop.
Save dr2050/579db399356f447f862fb6565686ffcc to your computer and use it in GitHub Desktop.
Deletes all your iOS Simulators
#!/usr/bin/env ruby
`xcrun simctl shutdown all`
device_lines = `xcrun simctl list`.split("\n")
device_lines.each do |line|
line.strip!
matches = /[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/.match(line)
if matches
`xcrun simctl delete #{matches}`
puts "Deleting sim with ID #{matches}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment