Xcode is an Apple-created developer's toolkit for iOS and macOS app development. Xcode is one of the best tools for developers, but projects can take up a lot of space on your Mac hard disk.
The app also generates a lot of "temporary" cache files that will grow over time until they become a hidden monolith of space waste. More than just wasting space, the junk can slow Xcode down, sometimes making it non-responsive.
When this happens you need to clean Xcode by completely removing old cache files and the app itself before doing a fresh Xcode install.
If you think you don't need help uninstalling Xcode, think again. A normal uninstall will not remove all the cache junk.
So to be very clear, when removing Xcode do not just move the icon to the Trash bin. This doesn't uninstall Xcode app completely, only parts of it. Caches, supporting files, your old builds, and so on — will remain on your drive in multiple directories and libraries.
Don't worry, we'll show you how to safely and, most importantly, completely remove Xcode from your Mac.
How to uninstall Xcode manually
If you want to get your hands dirty then you've come to the right place, but before you start, please note the following:
Manually removing files comes with some risk. If you don't follow the instructions carefully, you could experience unintended consequences. We assume no responsibility for what may occur from a manual app removal.
If you're up for the challenge, please carry on. If you would prefer the safer methods, go ahead and skip this section.
Now that we've cleared this up, here’s how to get Xcode off your Mac by hand:
- Open the Applications folder
- Drag the Xcode icon to the Trash
- Clean out the Trash bin
This will delete the main part of the app. Now, to the rest of the Xcode files.
- Open Finder.
- In the top menu, choose Go.
- Go to Folder...
- Find the Developer folder.
- Delete it.
If you had earlier versions of Xcode, like 7 or 8, they leave footprints all over the place. To remove these remnants of old Xcode iterations follow these steps:
- Open Terminal.
- Run: sudo /Developer/Library/uninstall-devtools --mode=all
- Confirm your admin password.
- Wait until the scripts are done running.
- Quit Terminal.
The only thing left is getting rid of Xcode application caches. In some versions of the app they are left even after the purging, so visit this directory to make sure you have no files stored there.
If you find any files, clean up the folder.
Once all traces of Xcode have been removed, reinstall the app and you should enjoy a much faster experience. You’ll also have more space on your hard disk to play with.
How to quickly remove old Xcode build files
If you think the manual method sounds too risky and complicated, we’re going to show you a much better way to remove old Xcode build files. No need for dirty hands and crossed fingers, you just need to download an uninstaller app like CleanMyMac 3.
Follow these steps to easily remove old Xcode build files:
- Launch CleanMyMac 3
- Click on System Junk module
- Click Scan
- When the scan finishes click on Review
- If you only want to clear Xcode files click Deselect All before you start
- Now click on Xcode Junk
- Select old iOS simulators, Xcode Derived Data (the old project builds), and old caches you don’t need anymore
- Click Clean
In the example above we were able to free up almost 15GB of wasted space. Not bad for a couple minutes of work. Can you do even better?
How to quickly remove Xcode
The fastest way to get an Xcode-free Mac is to download CleanMyMac 3 for free and use its uninstaller tool. This way the whole process will only take a couple of minutes and you won’t have to worry about the leftover files or deleting the wrong thing with a manual removal.
Here’s how it works:
- Launch CleanMyMac 3.
- Click on the Uninstaller tab.
- Find Xcode on the list and select it.
- Click Uninstall.
Now, dealing with caches and stray parts:
- Choose System Junk tab.
- Run Scan.
- Click Review Details.
- Scroll to the bottom and choose Xcode junk.
- Hit Clean.
Xcode junk removed
Whether you want to uninstall Xcode completely or just get rid of old Xcode junk, we recommend you take action. You’ll gain more storage space and a lighter, cleaner, and faster Xcode experience.
Whether you use manual folder-crawl or take the safe approach with CleanMyMac’s quick click fixes, just do it!
These might also interest you:
- How to Clear Your Scratch Disk and Photoshop Cache on Mac
- What is iCloud Drive on macOS Sierra and how it works?
- Simple Ways to Reduce Memory Usage on the Mac