16

I performed a fresh install of macOS Mojave 10.14. Immediately after that I installed Xcode Version 10.0 (10A255) from the Mac App Store.

Now, I wish to install Homebrew which requires Xcode command line tools to be installed. My understanding is that installing Xcode also installs the command line tools. Or not?

As per this answer, I checked if the command line tools are installed by running:

xcode-select -p

which printed the path for the Developer directory as follows:

/Applications/Xcode.app/Contents/Developer

As suggested in the answer, I also verified the return value by running:

echo $?

which retuned 0.

I also ran, gcc and make and bash was able to locate and execute them.

Thus far I am convinced that the Xcode command line tools are installed. Now when I execute:

xcode-select --install

I get this alert:

enter image description here

What's the probable reason for this disparity? Will this install Xcode command line tools twice? Or overwrite the existing installation?

As I understand, Xcode command line tools can be installed without installing Xcode. Also, from my previous experience, if the command line tools aren't installed separately from Xcode (by running xcode-select --install), they are not detected by Homebrew, i.e. when running brew config, the value for CLT: is shown as N/A.

Here's the complete picture (pardon the pun):

enter image description here

Although I am talking in context of macOS Mojave, the question remains the same with regard to previous versions of macOS.

What is the advisable approach to take here?

Note: After installing Xcode, I launched it, accepted license agreement and let it finish its run of installing additional tools (which is a one time activity).

Nimesh Neema
  • 1,528
  • 2
  • 17
  • 44

1 Answers1

31

Following worked for me, only command line tool can also me installed.

After you updated to Mojave 10.14 Go to https://developer.apple.com/download/more/ search for "command line" then

Download "Command line tool for MacOS 10.14"

Once dmg is downloaded install the package.

Verify package installation enter image description here

Jyoti Prakash
  • 3,921
  • 3
  • 21
  • 24
  • 1
    Best Answer! Thank you. Now this command works: `pkgutil --pkg-info=com.apple.pkg.CLTools_Executables` and Brew sees it: `brew config`. – Tony-Caffe Nov 01 '18 at 16:32
  • 3
    Hmm, do you have any insight into the specific question `What's the probable reason for this disparity? Will this install Xcode command line tools twice? Or overwrite the existing installation?` – Samuel Li Nov 04 '18 at 04:57
  • After Mojave 10.14 update GIT was not working for me, I checked and my commandLineTools folder was empty so I manually installed it. – Jyoti Prakash Nov 05 '18 at 08:16
  • This didn't work for me - the command line tools installer said "there is no new software to install". It knows it's already installed...I think the problem is with homebrew not looking in the new location for command line tools. – Trev14 Feb 05 '19 at 17:09