13

This SO post explains very well how to install command line tools for Xcode 4.4.

But how to uninstall them?

Community
  • 1
  • 1
user456584
  • 86,427
  • 15
  • 75
  • 107
  • Even without uninstalling them, you can probably do xcode-select and prefix all build commands with xcrun to use a different version's command line tools. I don't know of an uninstaller (other than TimeMachine restore or manually hunting down files), but installing command line tools of a different Xcode will probably overwrite them. – webjprgm Jul 26 '12 at 22:24
  • /Applications/Developer/Xcode.app/Contents/Developer/usr shows all the command line tools it likely installed, if you want to manually remove them. I haven't yet found a .pkg file that looks like a tools installer. – webjprgm Jul 26 '12 at 22:29
  • 1
    Yeah, had exactly the same problem ... I haven't found a solution for this, yet. Initially, I wasn't able to install the command line tools from the Xcode -> Downloads, etc. so I've installed it by downloading it as a separate package and now Xcode can see it as being installed. So, I wanted to remove it and repeat the procedure (hoping that it was fixed - the installation using Xcode -> Downloads), but I can't. – Alin Aug 07 '12 at 20:09

4 Answers4

18

There's a script listed on this page to do just that on Mountain Lion: http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/

Copy the script into a text file.
Save it as remove_CLI_tools.sh
Open terminal and navigate to the folder where you saved the script.
Type: sh remove_CLI_tools.sh

I installed just the isolated command line tools (stand alone installer) without installing the Xcode application. So I ended up running the script twice, changing the variables at the top for each of the packages installed by the installer
(you can check which packages were installed by looking in the hidden "Packages" file of the .dmg image of the installer):
com.apple.pkg.DeveloperToolsCLI.bom and .plist com.apple.pkg.DevSDK.bom and .plist

Be careful (have a backup, like the post recommends).

creativecoder
  • 1,631
  • 1
  • 13
  • 7
0

sudo /Developer/Library/uninstall-devtools –mode=all works for 10.8.5

ytf3333
  • 9
  • 1
-1

This should still work to remove xcode.

sudo /Developer/Library/uninstall-devtools –mode=all
padapa
  • 307
  • 2
  • 12
-2

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

Mina Almasry
  • 173
  • 1
  • 2
  • 12