Skip to content

Instantly share code, notes, and snippets.

@joshjensen
Created November 20, 2012 14:20
Show Gist options
  • Save joshjensen/4118203 to your computer and use it in GitHub Desktop.
Save joshjensen/4118203 to your computer and use it in GitHub Desktop.
Switch iOS Simulators
set selectedDevices to {"iPhone (Retina 3.5-inch)"}
if selectedDevices is not false then
set selectedDevice to item 1 of selectedDevices as string
set thePListFolderPath to path to preferences folder from user domain as string
set thePListPath to thePListFolderPath & "com.apple.iphonesimulator.plist"
tell application "System Events"
tell property list file thePListPath
tell contents
set value of property list item "SimulateDevice" to selectedDevice
end tell
end tell
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment