Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Reset all iOS Simulators
- simulatorList = []
- # Get all of the simulator UUIDs from Xcode
- rawSimulatorList = `xcrun simctl list`
- rawSimulatorList.each_line do |line|
- if line.start_with?(" ")
- simulator = line.strip
- # Ignore any simulators that aren't working
- if !simulator.include?("unavailable")
- # Extract the UUID
- uuid = simulator.match(/\([A-Z0-9\-]+\)/)[0]
- uuid = uuid.gsub("(","")
- uuid = uuid.gsub(")","")
- # Extract the device name
- deviceName = simulator.split(' ')[0] + " " + simulator.split(' ')[1]
- device = { "name" => deviceName, "uuid" => uuid }
- simulatorList.push(device)
- end
- end
- end
- puts "We will be resetting #{simulatorList.count} simulators."
- notRecognizedResponse = true
- while notRecognizedResponse
- print "Continue? (Yes/No) [Yes]: "
- response = gets.chomp.downcase
- if response == "no"
- exit
- elsif response == "yes"
- notRecognizedResponse = false
- elsif response == ""
- notRecognizedResponse = false
- end
- end
- simulatorList.each do |simulator|
- print "Erasing #{simulator['name']}... "
- `xcrun simctl erase #{simulator['uuid']}`
- puts "Done"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement