Skip to content

Instantly share code, notes, and snippets.

@hirad
Created February 17, 2017 22:18
Show Gist options
  • Save hirad/bc7e3732ddf509da02b1d6d5a56798f5 to your computer and use it in GitHub Desktop.
Save hirad/bc7e3732ddf509da02b1d6d5a56798f5 to your computer and use it in GitHub Desktop.
AppleScript to clean Xcode project, quit it, nuke derived data, re-open it and build
tell application "Xcode"
set workspaceFile to file of active workspace document
tell active workspace document
set res to (clean it)
repeat
if completed of res is true then
exit repeat
end if
delay 1.0
end repeat
end tell
activate
quit
end tell
tell application "Finder"
set ddFolder to POSIX file "/Users/hiradmotamed/Library/Developer/Xcode/DerivedData"
delete ddFolder
end tell
tell application "Xcode"
delay 4.0
activate
open workspaceFile
delay 2.0
tell application "System Events" to keystroke "u" using {command down, shift down}
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment