78

I installed Xcode command line tool by issuing xcode-select --install; now I want to uninstall it (without uninstalling Xcode).

I've tried

sudo /Developer/Library/uninstall-devtools --mode=all

but then I get the error

sudo: /Developer/Library/uninstall-devtools: command not found
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
TomNg
  • 1,897
  • 2
  • 18
  • 25
  • 2
    I believe your `$PATH` is messed up? What's the output when you type `which sudo` or `whereis sudo`? Hopefully it prints something like `/usr/bin/sudo`? – aug Dec 12 '14 at 07:02
  • 3
    https://developer.apple.com/library/ios/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_DO_I_UNINSTALL_MY_COMMAND_LINE_TOOLS_ – Matthias Bauch Dec 12 '14 at 07:56
  • See also https://apple.stackexchange.com/questions/308943/how-do-i-uninstall-the-command-line-tools-for-xcode – Günter Zöchbauer Nov 23 '22 at 08:41

3 Answers3

97

If you installed the command line tools separately, delete them using:

sudo rm -rf /Library/Developer/CommandLineTools
Carolus
  • 477
  • 4
  • 16
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
55

An excerpt from an apple technical note (Thanks to matthias-bauch)

Xcode includes all your command-line tools. If it is installed on your system, remove it to uninstall your tools.

If your tools were downloaded separately from Xcode, then they are located at /Library/Developer/CommandLineTools on your system. Delete the CommandLineTools folder to uninstall them.

you could easily delete using terminal:

Here is an article that explains how to remove the command line tools but do it at your own risk.Try this only if any of the above doesn't work.

Community
  • 1
  • 1
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
7

You can simply delete this folder

/Library/Developer/CommandLineTools

Please note: This is the root /Library, not user's ~/Library).

MrDEV
  • 3,490
  • 1
  • 19
  • 20