How to Uninstall XCode
Included below 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 Mac 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 Mac 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 10, 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:
/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”
Xcode data files locations
The full set of Xcode related data, which you may want to backup or delete if youare uninstalling Xcode from a Mac, are the following locations and files:
/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
You can manually delete those files as well, but again if you care about preserving your environment then consider backing up the data before manually removing Xcode apps, files, and components.
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.
To fully uninstall Xcode
(and not lose your custom settings):
https://forums.developer.apple.com/message/341753#341753
This uninstall is naive. Xcode has always put piles of garbage all over the hard disk.
This advice no longer works so it wont be breaking anyones computer anymore…
sudo /Developer/Library/uninstall-devtools –mode=all
sudo: /Developer/Library/uninstall-devtools: command not found
BAD advice. Bad bad advice. I’m on OS X El Capitan and it totally ruined my whole system – Finder kept rebooting, couldn’t startup, the graphic card switching utility got deleted, I used the terminal command to delete everything related to Xcode. I had to reinstall OS X but realised I didn’t do a recent backup, and now I’m stuck. So… Execute terminal commands at your own peril!
Thanks for this article! I was getting strange error messages trying to install MacPorts and other tools, it turned out I had both an old version of Xcode and a current version installed. Running the uninstall-devtools command as described above cleaned out the old version and left the current Xcode (5.1.1 on my machine) unaffected, and all my build errors have cleared up.
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.
The script does not even exist!
Running Sierra.
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.
[…] 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 […]
[…] 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 […]
This is very useful! Because I am using 3.X :)
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.
[…] Via | OSXDaily […]
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. ;)
Despite being published today, this article is already out of date with Xcode 4.3, which is now a self-contained application in /Applications.
Oops, thanks for pointing this out! I have 4.1 installed