Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] macOS - Determine Xcode command tools version in Terminal
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
Topic starter
October 11, 2023 2:04 AM
With all the changes lately, I found it a challenge to determine what version command-line tools I had installed on my Mac.
After all, XCode gives me a rather useless number:
$ xcode-select --version
xcode-select version 2397
But with some help I did find that the CLang version (clang --version) is the indicator we need to look for (now that makes sense, and why is Xcode version not showing this?)
$ clang --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
So there ya go: command line tools 15 ... (in this example)
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
Topic starter
October 11, 2023 5:08 AM
Well another, probably more correct way (requires XCode to be installed):
xcodebuild -version
Results in:
$ xcodebuild -version
Xcode 15.0
Build version 15A240d
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
Topic starter
October 12, 2023 2:58 AM
Interesting additional info is by looking at the install/update history ...
$ softwareupdate --history | grep Command
Command Line Tools for Xcode 14.2 09/22/2023, 12:54:57
Command Line Tools for Xcode 14.3 09/22/2023, 12:54:57
Command Line Tools for Xcode 15.0 09/22/2023, 12:54:57
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
Topic starter
January 4, 2024 8:17 AM
And another way to test this:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables