todd-dsm / mac-ops

QnD Automation to build a MacBook Pro for DevOps
MIT License
11 stars 7 forks source link

Install Xcode CLI Tools Automatically #84

Open todd-dsm opened 2 years ago

todd-dsm commented 2 years ago

Found this floating around out there; may not be needed any longer...

###----------------------------------------------------------------------------
### Install the Xcode CLI Tools                                                   
### UPDATE: this will get installed as a dependency to Homebrew                   
### FIXME: https://github.com/todd-dsm/mac-ops/issues/33                          
###----------------------------------------------------------------------------
echo "Watch for on-screen prompts about sshd-keygen-wrapper: Accept"              

xcode-select --install                                                            

sleep 10                                                                          
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