13

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?

21
+50

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.

  • 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 '16 at 12:31
  • Did you delete the /Library/Developer/CommandLineTools/? – Allan Jun 22 '16 at 12:34
  • No, as not indicated in your procedure. Going to. – giampaolo Jun 22 '16 at 12:36
  • 7
    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 '16 at 3:33
  • 1
    Small update: brew doctor doesn't return any errors in my system: deleting with AppCleaner was enough. – Mehdi Aug 28 '17 at 13:35

You must log in to answer this question.

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