Skip to content

Instantly share code, notes, and snippets.

@ryanmaclean
Last active May 6, 2016 09:19
Show Gist options
  • Save ryanmaclean/c75d1a8d6bf87a4fb008 to your computer and use it in GitHub Desktop.
Save ryanmaclean/c75d1a8d6bf87a4fb008 to your computer and use it in GitHub Desktop.
Install Xcode Entirely from Command Line in Apple OSX Yosemite (10.10)
# Using tccutil.py to help us here, instead of making plist files
# https://github.com/jacobsalmela/tccutil
curl -o tccutil.py https://raw.githubusercontent.com/jacobsalmela/tccutil/master/tccutil.py
chmod +x tccutil.py
sudo ./tccutil.py -i /usr/bin/osascript
sudo ./tccutil.py -e /usr/bin/osascript
sudo ./tccutil.py -i /System/Library/CoreServices/System\ Events.app
sudo ./tccutil.py -e /System/Library/CoreServices/System\ Events.app
sudo ./tccutil.py -i /Applications/Utilities/Terminal.app
sudo ./tccutil.py -e /Applications/Utilities/Terminal.app
# Based on https://gist.github.com/brysgo/9007731
cat > /tmp/xcode-select.scpt <<EOF
do shell script "xcode-select --install"
do shell script "sleep 1"
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
delay 3
click button "Agree" of window "License Agreement"
end tell
end tell
EOF
/usr/bin/osascript ~/xcode-select.scpt
# Cleaning up our entries
sudo ./tccutil.py -r /usr/bin/osascript
sudo ./tccutil.py -r /System/Library/CoreServices/System\ Events.app
sudo ./tccutil.py -r /Applications/Utilities/Terminal.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment