Monday, 8 June 2015

xocde, swift reset simulator



First you should create a file and name it as xx.script: (or other proper name)


tell application "iOS Simulator"
activate
end tell

tell application "System Events"
tell process "iOS Simulator"
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
tell window 1
click button "Reset"
end tell
end tell

end tell


You can put in any place you want. What I did was just in my user folder.

Then you can verify the script by run this in you Terminal. (make sure your simulator is running)

osascript "~/xx.script"

then you can put it into your xcode like this:




It will reset your simulator before you run your app everytime.




useful links:

http://www.codedisqus.com/0iJgjkeVkV/how-can-i-reset-the-ios-simulator-from-the-command-line.html

https://gist.github.com/jakemarsh/1647709





No comments:

Post a comment