Skip to content

Instantly share code, notes, and snippets.

@MLKrisJohnson
Created November 11, 2019 18:53
Show Gist options
  • Save MLKrisJohnson/359ee9fa590ad6eda3c464f6bbf559f2 to your computer and use it in GitHub Desktop.
Save MLKrisJohnson/359ee9fa590ad6eda3c464f6bbf559f2 to your computer and use it in GitHub Desktop.
AppleScript that tells Xcode to do a "Clean" and then a "Build"
tell application "Xcode"
tell active workspace document
set actionResult to clean
repeat
if completed of actionResult is true then
exit repeat
end if
delay 0.5
end repeat
set actionResult to build
repeat
if completed of actionResult is true then
exit repeat
end if
delay 0.5
end repeat
end tell
end tell
@MLKrisJohnson
Copy link
Author

Tip: In Script Editor > Preferences > General, enable the Script Menu, and then put this script in your ~/Library/Scripts/Applications/Xcode directory so it will appear in the script menu when Xcode is active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment