Where is xcode command line tools installed to when using the downloaded pkg file?

6.6k Views Asked by At

I have Xcode installed on my computer. Initially I installed the xcode command line tools by prompt when opening Xcode. In my Xcode preferences, in the locations section, command line tools read Xcode 12.0 (12A7209) and below it the path /Applications/Xcode.app. However, as documented NUMEROUS times on stack overflow, Homebrew was not recognizing my xcode command line tools (CLT: N/A). So I downloaded the pkg file from Apple Developer and reinstalled the command line tools with that pkg file as the command line install xcode-select --install didn't work. The gui installer finished with no errors. Now, Homebrew recognizes my CLT.

Question: if Xcode already installed command line tools, then what location did the downloaded pkg file from Apple developer install the command line tools too? Did this leave me with 2 versions of the xcode command line tools on my system?

Running xcode-select -p outputs the following, as many people have already noted: /Applications/Xcode.app/Contents/Developer

Additionally which -a xcode-select also only returns /usr/bin/xcode-select.

What did the additional pkg installation do on my computer?

What's the use of having Xcode install the xcode command line tools when opening, if we have to re-install them from pkg anyway to get command line programs to read it?

1

There are 1 best solutions below

3
On

if Xcode already installed command line tools, then what location did the downloaded pkg file from Apple developer install the command line tools too?

/Library/Developer/CommandLineTools

Did this leave me with 2 versions of the xcode command line tools on my system?

Not exactly "xcode" command line tools, but two CLTs, yes. Ideally homebrew should use xcrun to find them and use whichever available.

Running xcode-select -p outputs the following, as many people have already noted: /Applications/Xcode.app/Contents/Developer

That is correct and expected. If you have Xcode, the Xcode's CLTs should be used. If you delete Xcode, it should output:

/Library/Developer/

You can manually change this path by

xcode-select -s <path>

What did the additional pkg installation do on my computer?

It just sits there for anyone to use it.

What's the use of having Xcode install the xcode command line tools when opening, if we have to re-install them from pkg anyway to get command line programs to read it?

It's brew's bad to not use the already existing Xcode CLTs.