OSX administrators who use Brew - Xcode Tools no longer included by default



  • If you support OSX Mojave as of recently (not sure exactly when) Xcode tools aren't included by default. This obviously means you can no longer just install brew and setup your OSX systems via cli without first adding the dependencies required (Xcode tools for the CLI).

    To automate this process you'll have to download the tools from the developer portal first and put them somewhere where your shell script is run from. I run all of this from a USB drive, so this dependency is called from there.

    So login to https://developer.apple.com and download the Xcode Tools for 10.14 (likely to change at some point. . .)

    Add this to the top of your Brew shell script to automate the process.

    hdiutil attach /Path\ to/Command_Line_Tools_macOS_10.14_for_Xcode_10.2.dmg
    
    sudo installer -pkg /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools\ \{macOS\ Mojave\ version\ 10.14\).pkg -target "/"
    
    hdiutil detach /Volume/Command*
    

    Continue your shell script from there and brew will take care of the rest.