How to Uninstall XCode
Updated 12/17/2015: Included are new simple instructions for uninstalling modern versions of Xcode. Deleting old versions of Xcode is covered as well, this is a thorough guide to uninstall Xcode from any Mac regardless of version and OS X release.
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?
How to delete Xcode depends on what version you are trying to remove from the Mac. We’ll cover removing newer versions of Xcode first, then cover deleting the older versions of the app as well.
Uninstall Xcode 9, Xcode 8, etc from Mac OS X
To uninstall newer versions of Xcode is much like deleting any other app from the Mac:
- Navigate to the /Applications/ folder and locate “Xcode” application
- Drag “XCode” to the Trash and empty the trash as usual by right-clicking on the Trash icon and choosing ‘Empty Trash’
Next you’ll probably want to delete the user Developer tools folder, found at the following location – note this includes user developer data, so don’t do this if you have projects and other data in Xcode that you haven’t backed up elsewhere or you otherwise care about:
The directory is ~/Library/Developer/, the user folder should contain “Xcode” and “CoreSimulator” folders:
- Open the user home directory and go to Library
- Visit the “Developer” folder and delete it
Trashing those folders along with the application should restore about 11GB of disk space from the Mac and OS X will no longer have Xcode. If you’ve installed command line tools separately, they should not be impacted by deleting xcode itself.
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 versions should be able to uninstall like any other Mac app, whereas older versions of XCode require the manual process outlined below.
Completely Uninstall Xcode from Mac OS X
Note that uninstalling Xcode is different for earlier releases of the app. The directions below are still valid for all earlier versions of Xcode, however, and you’ll find 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.
This will remove everything pertaining to Xcode from a Mac:
- Launch the Terminal, found in /Applications/Utilities/ and type the following:
- Confirm the admin password (required for sudo) and let the scripts run
sudo /Developer/Library/uninstall-devtools --mode=all
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.
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:
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.