How to Uninstall XCode

Feb 20, 2012 - 10 Comments

Uninstall Xcode

Update 7/6/2012: Uninstalling Xcode 4.3 and later are easier than ever, all you need to do is go to /Applications/ and delete the Xcode app. Yup, that’s it. Simple. The directions below are still valid for earlier versions of Xcode, however:

Xcode is Apple’s developer suite for iOS and Mac OS X, it’s necessary if you intend to be write apps for either OS and installing it includes a number of other useful utilities other than the main IDE itself. The additional aspects include things like the Interface Builder, iPhone Simulator, Quartz Composer, Dashcode, gcc, dtrace, perl, python, ruby, and much more that has use beyond core iOS and OS X development, adding valuable utilities to tweakers and administrators toolkits.

Installing Xcode is just a matter of downloading it from the Mac App Store, but what if you want to remove Xcode? Doing so is not the same as uninstalling general Mac apps or even ditching the default apps because Xcode has a much larger footprint, so to uninstall Xcode you’ll need to venture into the command line.

Update: Our readers pointed out that Xcode 4.3 simplifies this process considerably by bundling Xcode into a single application. Therefore, this guide is most relevant to older versions. XCode 4.3 and later should be able to uninstall like any other Mac app. Thanks Mike & Peter!

Completely Uninstall Xcode

This will remove everything pertaining to Xcode from a Mac:

  • Launch the Terminal, found in /Applications/Utilities/ and type the following:
  • sudo /Developer/Library/uninstall-devtools --mode=all

  • Confirm the admin password (required for sudo) and let the scripts run

Don’t Forget to Delete the Install Xcode Application
If you uninstall Xcode, the original Install Xcode application is probably still sitting in your /Applications/ folder as downloaded from the Mac App Store, don’t forget to delete this too otherwise you are wasting 1.8GB of disk space.

Why Uninstall Xcode?

If you don’t use Xcode or it’s accompanying utilities it’s a good idea to uninstall the suite. Why? The simplest reason is because Xcode takes up a lot of disk space, generally a minimum of 7GB of disk space is consumed by the installation, and the installer application alone is another 1.8GB, that’s a lot of storage capacity taken up by something that is potentially getting no use.

Uninstall Xcode


Now that we’ve covered the basic process of uninstalling everything to do with Xcode and why some people would benefit from doing so, we’ll dive into some more specific information and some other uninstall options that could be useful to some users.

First, the the above uninstall command with -mode=all actually just runs three separate scripts making the uninstallation process easier, for those who are curious those separate scripts are:

/Library/Developer/Shared/uninstall-devtools
/Library/Developer/4.1/uninstall-devtools
/Developer/Library/uninstall-developer-folder

These do not need to be run independently, although you could chose to do so if you wanted to, more on that below.

If you want to selectively uninstall parts of Xcode rather than everything, use the commands below. These are not necessary if you run the above –mode=all command.

Uninstall Xcode’s Unix Development Toolkit

If you only want to remove the command line side of things, you can do that with this command:

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

This is actually linked to the aforementioned “/Library/Developer/Shared/uninstall-devtools” script. Personally, I think the unix toolkit is one of the most useful aspects of installing Xcode so I’m not sure why you’d want to do this, but it’s nice to know you can.

Uninstall the Xcode Developer Folder and Contents Only

This will keep other aspects of Xcode intact but will remove everything within the /Developer directory:

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

This command is basically a shortcut to the previously mentioned “/Developer/Library/uninstall-developer-folder” script. If you want to ditch the /Developer directory, run this command rather than manually deleting it through the Finder.

Uninstall Xcode System Support

Selectively uninstall Xcode’s system support only (not recommended):

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

This command just runs the following scripts: “/Library/Developer/Shared/uninstall-devtools” and “/Library/Developer/4.1/uninstall-devtools”

That just about wraps it up. You may be able to accomplish some of these tasks with an removal utility like AppCleaner as well, but for best results it’s a good idea to stick with the solution bundled with Xcode itself.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Development, Mac OS X, Tips & Tricks

10 Comments

» Comments RSS Feed

  1. Mike says:

    Despite being published today, this article is already out of date with Xcode 4.3, which is now a self-contained application in /Applications.

  2. Peter says:

    This was simplified with Xcode 4.3, you must have an old version installed.

    “The simplification afforded by repackaging Xcode 4.3 as a single app bundle eliminates the need for the /Developer directory containing prior versions of Xcode. As a result, the Install Xcode application and the uninstall-devtools command line script are also no longer needed.”

    https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html

    Should be a useful guide for anyone prior to 4.3 though. ;)

  3. aaron says:

    This was useful for me; I was updating to the ‘new’ xcode but still had the /developer folder around and needed to get rid of it.

  4. Aw Guo says:

    This is very useful! Because I am using 3.X :)

  5. [...] other development utilities. If you want to slim down your development footprint, you can always uninstall Xcode by deleting the app from /Applications/ and then manually installation the Command Line Tools [...]

  6. [...] way Xcode is installed, bundling everything into a single /Applications/Xcode.app/ directory and removing the /Developer directory that used to exist. There are some advantages to this approach, but one of [...]

  7. Lauri Ranta says:

    Newer versions of Xcode still keep documentation in ~/Library/Developer/. You could also remove ~/Library/Caches/com.apple.dt.Xcode/.

    You can search for other support files with mdfind -name xcode -0 | xargs -0 du -sm | sort -rn.

  8. Paul says:

    I can’t seem to remove Xcode from my MBP. I’ve been searching everywhere, but keep running into the same suggestion: Run “sudo /Developer/Library/uninstall-devtools –mode=all” from Terminal. And unfortunately, every time I do, I get errors and nothing gets removed.

    How do I completely remove the Developer Tools manually without having to use an uninstall script? The script just doesn’t work for me.

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates