Created
March 13, 2014 21:24
-
-
Save Reflejo/9537281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript | |
on run argv | |
if count of argv < 1 then | |
logEvent("Usage: ./changeVersion iOSVersion(7.1,7.0)") | |
error number -128 | |
end | |
set iOSVersion to item 1 of argv | |
tell application "Xcode" to activate | |
try | |
tell application "System Events" | |
tell process "Xcode" | |
tell menu bar 1 | |
tell menu bar item "Product" | |
tell menu 1 | |
tell menu item "Destination" | |
tell menu 1 | |
tell menu item "iPhone Retina (4-inch)" | |
tell menu 1 | |
click menu item ("iOS " & iOSVersion) | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
on error errMsg | |
logEvent ("Error: " & errMsg) | |
end try | |
end run | |
to logEvent(themessage) | |
do shell script "echo '" & themessage & "' >> ~/Library/Logs/AppleScript-events.log" | |
end log_event |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment