Skip to content

Instantly share code, notes, and snippets.

@timonus
Created August 20, 2015 20:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timonus/717c9b24880167641021 to your computer and use it in GitHub Desktop.
Save timonus/717c9b24880167641021 to your computer and use it in GitHub Desktop.
Deletes all yer iOS simulators
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
devices.each do |device|
puts "Removing device #{device[0]} (#{device[1]})"
`xcrun simctl delete #{device[1]}`
end
# device_types.each do |device_type|
# runtimes.each do |runtime|
# puts "Creating #{device_type} with #{runtime}"
# command = "xcrun simctl create '#{device_type[0]} #{runtime[0]}' #{device_type[1]} #{runtime[1]}"
# command_output = `#{command}`
# sleep 0.5
# end
# end
@timonus
Copy link
Author

timonus commented Aug 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment