tell application "System Events"
do shell script "open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\\ Simulator.app/"
delay 2
tell process "iOS Simulator"
set frontmost to true
tell menu bar 1
tell menu bar item "iOS Simulator"
tell menu "iOS Simulator"
click menu item "Reset Content and Settings…"
end tell
end tell
end tell
delay 1
perform action "AXRaise" of window 1
tell window 1
click button "Reset"
end tell
end tell
end tell
tell application "iPhone Simulator" to quit