As by subject. There are a number of links, such as this that deal with the issue but are not El Capitan specific and/or are just not that on the subject or are not up to date.

Is it possible to Uninstall XCode 7 while keeping the Command Line Tools (and still being able to get the CLT upgrades)? Should I just uninstall everything and reinstall just the CLT (how?)?

Any other way?

2 Answers 2


Personally, I think that instead of trying to "bodge" a method of uninstalling Xcode while leaving CLT intact is too cumbersome. My suggestion is to:

  1. Uninstall Xcode completely
  2. Install Xcode CLT

Doing this should take you less than 5 minutes total and is quite simple.

Uninstall Xcode

There are a number of different ways to uninstall Xcode. An excellent tutorial can be found at OSXDaily.

However, the most reliable way I have found to uninstall software is with the free app recommended by Macworld.com called AppCleaner. You can "drag and drop" or "Search" for your apps that you want to remove and it will find all related files/directories for you - even the ones that get installed as launch daemons.

Disclaimer: I am not affiliated with the app or the developers of the app in any way.

Install Xcode CLT (Yosemite through Sierra)

Installing Xcode CLT is actually quite simple. In Terminal, execute the following command:

xcode-select --install

You will get a dialog box that will prompt you to "Get Xcode," "Cancel," or "Install." Select "Install" to install the CLT only.

xcode-select install dialog

The installer will do its thing and will notify you once it's complete. Once finished, you will have access to tools such as git and svn. You can execute those commands by testing them out in Terminal.

CLT will be installed to /Library/Developer/CommandLineTools/

That's it! Xcode CLT are installed and ready for use.

  • 1
    I did exactly how you suggested. Xcode is removed while brew doctor for example gives me Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tooland xcode-select --install returns xcode-select: error: command line tools are already installed, use "Software Update" to install updates
    – giampaolo
    Jun 22, 2016 at 12:31
  • Did you delete the /Library/Developer/CommandLineTools/?
    – Allan
    Jun 22, 2016 at 12:34
  • No, as not indicated in your procedure. Going to.
    – giampaolo
    Jun 22, 2016 at 12:36
  • 8
    I tried this method on Sierra, actually AppCleaner won't delete the command line tool folder, and you don't need to. Just delete all files found by AppCleaner, then do sudo xcode-select --switch /Library/Developer/CommandLineTools/. Run brew doctor to make sure everything is OK.
    – Liu Siyuan
    Dec 6, 2016 at 3:33
  • 1
    Small update: brew doctor doesn't return any errors in my system: deleting with AppCleaner was enough.
    – Mehdi
    Aug 28, 2017 at 13:35

Monterey: uninstall Xcode, re-install CLI tools

Update: I just upgraded my MacBook Air to Monterey (took ages) then used Homebrew to install the apps I use. Running brew doctor warned of outdated Xcode. Read up, realised I only need Xcode to develop Apple apps (which I don’t do) but need the CLI tools. Did the following after reading through this and many other posts:

  1. brew install --cask appcleaner (I've used AppCleaner many times before)
  2. remove Xcode by dragging the Xcode app from Applications to AppCleaner and deleting all finds in one go via AppCleaner
  3. run brew doctor, which highlighted that there were now no CLI tools
  4. followed Homebrew message to xcode-select --install

All fine, thanks to some of the advice above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .