Skip to content

Instantly share code, notes, and snippets.

@brysgo
Created February 14, 2014 19:43
Show Gist options
  • Save brysgo/9007731 to your computer and use it in GitHub Desktop.
Save brysgo/9007731 to your computer and use it in GitHub Desktop.
Install xcode command line tools without prompt
do shell script "xcode-select --install"
do shell script "sleep 1"
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
end tell
end tell
@dspolleke
Copy link

dspolleke commented Apr 7, 2021

xcode-select --install > /dev/null 2>&1
if [ 0 == $? ]; then
    sleep 1
    osascript <<EOD
tell application "System Events"
    tell process "Install Command Line Developer Tools"
        keystroke return
        click button "Agree" of window "License Agreement"
    end tell
end tell
EOD
else
    echo "Command Line Developer Tools are already installed!"
fi

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