10

I wanted to enable the developer libraries in Mac (RoR, Perl, gcc etc.) so I installed Xcode 3.2. I am only interested in these command-line tools and will not be using Xcode (or other GUI tools with Mac and iPhone developer bells and whistles that are part of the SDK) at all, as I generally like to use a text editor and the command line.

How do I remove just those IDE tools while still keeping my programming environment intact? I'd rather reclaim the disk space.

2

As of recent releases of Xcode 4 you can now get the command-line tools as a separate download and installer - it's a much smaller download too: http://developer.apple.com/downloads.

You'll want to uninstall an existing Xcode install with the command:

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

before installing the command-line only tools.

|improve this answer|||||
  • 4
    I'm running El Capitan and there's no /Developer folder on my machine. (Which means no /Developer/Library, and a search also fails to turn up any uninstall-devtools utility.) – Dannid Feb 4 '16 at 19:26
1

Updating the answer for users looking to do the same in 2020.

(Tested on macOS Catalina 10.15.2)

Method:

  1. Uninstall the Xcode app - you can use storage management for this.
  2. Install the command line tools via the command xcode-select install
  3. Now try g++ -v, if you get an xcrun error which says that you need to install xcode command line tools using xcode-select install (which you just did), type in the xcode-select install again. If you get 'use "Software Update" to install update' error but you don't have any software updates to install in softwareupdate --list, try:
    sudo xcode-select --reset
|improve this answer|||||
0

My guess is that you'll have to delete things manually. You should be able to delete the Applications and Documentation folders, and the two iPhone platform folders if you aren't interested in that at all. That will get rid of most of the size (7.5GB out of 11.1GB for me, but I'm pretty sure some of that gets downloaded when you open Xcode and another 2GB was project files).

You might be able to delete the /Developer folder completely, but definitely have a backup before you try because the compilers might use files stored in there.

|improve this answer|||||
0

I am almost positive the gcc tools need Xcode to properly run as well.

|improve this answer|||||
  • 2
    Nah, I use GCC without XCode. – CoffeeRain May 21 '12 at 19:36
  • 1
    Also, it's "Xcode" - sorry: so many people see "Xcode" then write "xCode", "XCode" and whatever else.. – petert Jun 22 '12 at 12:50

You must log in to answer this question.

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