Uninstall Xcode Command Line Tools
Xcode Command Line Tools are tools for software developers that run on the command line, in the Terminal application. See the article About Xcode Command Line Tools.
Before you get started
You'll need a terminal application to uninstall Xcode Command Line Tools. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.
Why Uninstall Xcode Command Line Tools
You may wish to uninstall Xcode Command Line Tools for a variety of reasons:
- you've checked the Xcode Command Line Tools version and it is not current;
- you are using Homebrew and encountered errors with
brew doctor
; - a macOS upgrade may have partially removed Command Line Tools;
- you're no longer developing software and you want to free disk space.
How to Uninstall Xcode Command Line Tools
The simple and effective way to uninstall Xcode Command Line Tools is to delete its folder.
Find the Xcode Command Line Tools folder
Use the xcode-select -p
command to reveal the location of the Xcode Command Line Tools folder.
$ xcode-select -p
You should see:
/Library/Developer/CommandLineTools
If you see /Applications/Xcode.app/Contents/Developer
you have the full Apple Xcode package installed.
Remove the Xcode Command Line Tools folder
The simple and effective way to uninstall Xcode Command Line Tools is to delete its folder.
Remove the Xcode Command Line Tools 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).
Verify the uninstall
After uninstalling Xcode Command Line Tools, use the xcode-select -p
command to verify that Xcode Command Line Tools is not available.
$ xcode-select -p
xcode-select: error: unable to get active developer directory...
You can also check that the folder is gone.
$ ls -ag /Library/Developer
total 0
drwxr-xr-x 2 wheel 64 Jul 17 19:48 .
drwxr-xr-x 65 wheel 2080 Jun 28 12:36 ..
If you installed the full Xcode application, there may be cache or receipt files, but you won't have these if you installed only Xcode Command Line Tools.
That's it! You've removed Xcode Command Line Tools.
See the section, Reinstall Xcode Command Line Tools, if you want to restore Xcode Command Line Tools after uninstalling.
What's next
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.