Skip to content

Instantly share code, notes, and snippets.

@qwzybug
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwzybug/8702056 to your computer and use it in GitHub Desktop.
Save qwzybug/8702056 to your computer and use it in GitHub Desktop.
osascript xcrun.scpt <path to project> <scheme name>
on run argv
set projectPath to item 1 of argv
set projectScheme to item 2 of argv
tell application "Xcode"
open projectPath
activate
tell application "System Events"
tell application process "Xcode"
click menu item "Stop" of menu 1 of menu bar item "Product" of menu bar 1
click menu item projectScheme of menu 1 of menu item "Scheme" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
end tell
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment