Check Xcode Command Line Tools
To develop software on a Mac, you'll need Xcode Command Line Tools. See the article About Xcode Command Line Tools to learn what it's for. Here's how to check if Xcode Command Line Tools are already installed. If already installed, check if you have the most recent version.
If you updated your machine from an earlier macOS version, you may have an outdated version of Xcode or the Command Line Tools in place. Read on to check if you have a troublesome out-of-date Command Line Tools.
Before you get started, install a better terminal
Part of setting up your development environment is choosing the right terminal. MacOS includes the built-in Terminal app, but I recommend Warp Terminal. Even if you already use another terminal, now’s a good time to download Warp and try it for free.
Is macOS up to date?
You should check your macOS version before you install Xcode Command Line Tools. Check macOS and upgrade macOS if necessary.
Is Xcode already installed?
If you updated macOS from an earlier version with an "over the top" installation, your earlier development environment may remain intact. You will need to install the new version of Xcode Command Line Tools to avoid headaches. First, check what you have.
Check if you previously installed the full Xcode package:
$ xcode-select -p
You need to use the Terminal application to check from the command line.
Scenario 1
If you see, xcode-select: error: unable to get active developer directory...
, the Xcode package is not installed.
Good! Jump to either section:
- Install Xcode Command Line Tools with Homebrew (recommended)
- Install Xcode Command Line Tools Directly (alternative).
The Xcode package is not installed
Scenario 2
If you see a file location that contains spaces in the path:
/Applications/Apple Dev Tools/Xcode.app/Contents/Developer
you will have problems installing Homebrew. You should delete Xcode before continuing.
Scenario 3
If you see:
/Applications/Xcode.app/Contents/Developer
The full Xcode package is already installed. Perhaps you installed it previously. If Xcode is installed, you will need to update Xcode to the newest version. Go to the App Store application and check "Updates." After updating Xcode, be sure to launch the Xcode application and accept the Apple license terms.
Scenario 4
If you see:
/Library/Developer/CommandLineTools
The Xcode Command Line Tools may be installed or an empty directory may be present.
Here's how to test:
$ ls /Library/Developer/CommandLineTools/usr/bin/git
You should see:
/Library/Developer/CommandLineTools/usr/bin/git
Remove an empty folder
If the Xcode Command Line Tools folder is empty, you should remove it.
Remove the empty folder:
$ sudo rm -rf /Library/Developer/CommandLineTools
Use sudo
for admin privileges. You must enter the password you use to log in to your computer (you will not see the password after entering it). After removing the folder, continue to the article, Install Xcode Command Line Tools with Homebrew or Install Xcode Command Line Tools directly.
Check the Xcode Command Line Tools version
As of September 2025, the Xcode latest version is 26.0. You can check the Wikipedia page for Xcode to find the version number of the latest Xcode release.
Check with Homebrew
If you've installed Xcode Command Line Tools with Homebrew, you can run brew config
to check. It will display 'CLT' and a version number.
Check with pkgutil
You can also check directly with pkgutil
. Check the version of Xcode Command Line Tools by running pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
in the Terminal application.
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 26.0.1
You should see version 26 or newer.
Update if necessary
If the version is old, first Uninstall Xcode Command Line Tools and then Reinstall Xcode Command Line Tools.
What's next
If Xcode Command Line Tools are installed and up to date, you're done! You may want to Install Homebrew to continue setting up your development environment for programming.
My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.