xcodes icon indicating copy to clipboard operation
xcodes copied to clipboard

Ability To Install Xcode Command Line Tools

Open Gerst20051 opened this issue 3 years ago • 3 comments

It would be helpful to support installing just the command line tools instead of the full Xcode distribution.

Maybe the command would look something like this:

[$]> xcodes install 13.4 --tools

https://developer.apple.com/download/all/?q=Command%20Line%20Tools%20for%20Xcode%2013.4

https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_13.4/Command_Line_Tools_for_Xcode_13.4.dmg

I would just download it using curl but it seems to require authentication.

[$]> curl https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_13.4/Command_Line_Tools_for_Xcode_13.4.dmg -o ~/command_line_tools_for_xcode_13.4.dmg

Gerst20051 avatar Feb 02 '23 02:02 Gerst20051

Is this in a future roadmap? Is this a feature that the devs would be open to a pull request on?

Dunedubby avatar Sep 13 '24 04:09 Dunedubby

Finding: Command Line Tools path constraint

I discovered that the Command Line Tools can only be accessed through the fixed path /Library/Developer/CommandLineTools. This applies to both xcode-select and the DEVELOPER_DIR environment variable — neither supports alternative paths for CLT (only different Xcode.app locations).

Using a versioned path like /Library/Developer/CommandLineTools-26.2.0 results in: c++: error: unable to find Xcode installation from active developer path "/Library/Developer/CommandLineTools-26.2.0", use xcode-select to change

Implication for multi-version CLT support: To manage multiple CLT versions, a symbolic link at /Library/Developer/CommandLineTools pointing to the desired versioned directory (e.g., CommandLineTools-26.2.0) is required.

Limitation: This means true parallel usage of different CLT versions is not possible — only one version can be active at a time. For parallel builds requiring different toolchains, using multiple Xcode versions with DEVELOPER_DIR is the only workaround.

solarispika avatar Dec 30 '25 02:12 solarispika

Further investigation reveals that it works as long as the path ends in CommandLineTools. For example /opt/clt/26.2/CommandLineTools.

solarispika avatar May 18 '26 04:05 solarispika