Xcode is an Apple-created developer toolkit for iOS and macOS app development. It is one of the best tools for developers, but projects can take up more than 100 GB of space. More than just wasting space, old build files and caches can slow Xcode down and make it non-responsive. When that happens, you may need to clear those files or remove the app before doing a fresh Xcode install. We'll show you the correct way to do it.

Xcode icon

How much space does Xcode take on your Mac?

The app is only part of Xcode's storage use. If you're wondering why Xcode is so big, open Terminal and run these commands one at a time:

du -sh /Applications/Xcode.app

du -sh ~/Library/Developer

du -sh ~/Library/Developer/CoreSimulator

du -sh ~/Library/Caches/com.apple.dt.Xcode

du -sh ~/Library/Developer/Xcode/Archives

The first number is the app itself. ~/Library/Developer holds Xcode build data, archives, and Simulator data; the next two commands show parts of that folder. The cache folder is separate. Don't add all five numbers together: CoreSimulator and Archives are already included in ~/Library/Developer. If a path doesn't exist, Terminal will say so; you can skip it.

Before you uninstall Xcode, check Command Line Tools

⚠️ Important: Do this first if you use Homebrew, Git, or development tools in Terminal.

Xcode contains developer tools, but Apple also offers a separate Command Line Tools package. Homebrew requires that separate package for a supported development setup.

See which developer directory is active:

xcode-select -p

If you see /Applications/Xcode.app/Contents/Developer, your Mac is currently using Xcode. If you see /Library/Developer/CommandLineTools, it is using the separate Command Line Tools package. This command alone does not tell you whether the separate package is installed while Xcode is selected. Check for it directly:

ls /Library/Developer/CommandLineTools/usr/bin/clang

If Terminal says the file does not exist, install the separate package before removing Xcode:

xcode-select --install

Follow the installation dialog and wait for it to finish. If it says the tools are already installed, continue. After you remove Xcode, select the separate tools and check the result:

sudo xcode-select --switch /Library/Developer/CommandLineTools

xcode-select -p

The second command should return /Library/Developer/CommandLineTools. Later, run brew doctor if you use Homebrew. Some tools, including simctl and xcodebuild, require the full Xcode app and will stop working when you remove it.

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. Quit Xcode and Simulator, finish any active builds, and save any archives, simulator data, or projects you may need. The folder commands below delete files immediately, so check each path before running them. If you would prefer the simpler method, skip to the CleanMyMac section.

Now that we've cleared this up, here's how to get Xcode off your Mac by hand:

  1. Open the Applications folder.
  2. Drag the Xcode icon to the Trash.
  3. Empty the Trash when you're ready to remove the app.
how to uninstall Xcode from Mac

This will delete the main part of the app. Now, to the rest of the Xcode files.

  1. Open the Finder.
  2. In the top menu, choose Go > Go to Folder.
  3. Enter ~/Library/Developer/Xcode/ and press Return.
  4. Review the folder, especially Archives and iOS DeviceSupport. Copy anything you want to keep.
  5. Move the Xcode folder to the Trash.

Don't delete the entire ~/Library/Developer folder. It can contain data used by other developer tools. If you prefer Terminal, the command below removes only its Xcode subfolder after you've checked its contents:

rm -rf ~/Library/Developer/Xcode

If you had earlier versions of Xcode, you might also find old files in ~/Developer or /Developer. Check those folders in Finder before removing anything; the old sudo /Developer/Library/uninstall-devtools --mode=all instruction from earlier versions is not a current general-purpose uninstaller.

how to uninstall Xcode from MacBook


The only thing left in your user Library may be Xcode application caches. Visit this directory to check:

~/Library/Caches/com.apple.dt.Xcode

If you find any files, clean up the folder. You can also remove Xcode's user preferences and Application Support data if you want a fresh setup. In Finder, use Go > Go to Folder for each path and check that it belongs to Xcode:

~/Library/Application Support/Xcode

~/Library/Preferences/com.apple.dt.Xcode.plist

For more detail on which build data is safe to remove, see how to clear Xcode cache.

Check Simulator data and runtimes

Your simulated devices and installed Simulator runtimes are different things. ~/Library/Developer/CoreSimulator contains device data, including installed apps and settings. Move that folder to the Trash only if you no longer need those devices or their data. Check its size first:

du -sh ~/Library/Developer/CoreSimulator

Installed runtimes can also take space outside your home folder. Deleting ~/Library/Developer/CoreSimulator does not guarantee that the runtimes are removed. Before uninstalling Xcode, open Xcode > Settings > Components, review the installed runtimes, and delete those you no longer need there. If you use xcrun simctl runtime list, run it while Xcode is still installed and selected; simctl needs the full app.

After removal, run the Command Line Tools switch from the earlier section if needed. This takes care of the main app and the user data you've chosen to remove. You can now check your storage again; macOS may take a little time to update its storage figures.

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. It comes with a smart Cleanup feature that quickly finds unneeded files and lets you remove them with a click.

Here's how to remove old Xcode build files easily:

  1. Open CleanMyMac — get your free trial here.
  2. Go to Cleanup and click Scan.
  3. When the scan finishes, click Review All Junk.
  4. If you only want to clear Xcode files, find Xcode junk in the middle pane.
  5. Select files you no longer need and click Clean Up.

In the example above, we were able to free up almost 32 GB of wasted space. Not bad for a couple of minutes of work. Can you do even better? Your result will depend on the files on your Mac.

How to quickly remove Xcode

CleanMyMac comes with another tool that can help you quickly uninstall Xcode — the Applications feature. It hunts down all app-related files. This way, the whole process will only take a couple of minutes, and you won't have to worry about the leftover files or delete the wrong thing with manual removal.

Here's how to save yourself from the pain of manual Xcode removal:

  1. Open CleanMyMac.
  2. Go to Applications and run a scan.
  3. Click Manage My Applications and find Xcode on the list of all apps in the Uninstaller section.
  4. Select Xcode and any other apps you no longer need and click Uninstall.

Prefer Terminal? Clean Xcode junk with CleanMyMac CLI

If you work in Terminal, CleanMyMac CLI can show you Xcode caches and generated files before you delete them. Install it with Homebrew and check the installation:

brew install --cask cleanmymac-cli

cleanmymac --version

Then scan system junk, which includes supported Xcode DerivedData, Device Support, and other Xcode-related files:

cleanmymac clean junk

Review the results and deselect anything you want to keep before confirming. cleanmymac clean dev is available for other developer-tool caches, such as Homebrew and npm; it isn't an Xcode uninstaller. CleanMyMac CLI does not currently document a --xcode removal mode or automatic Command Line Tools and package-receipt cleanup, so use the manual steps above if you want to remove the app itself.

How to uninstall Xcode Command Line Tools only

If you want to reinstall the separate Command Line Tools package while keeping Xcode, first check that Xcode is still installed. Removing the separate package can interrupt Homebrew and commands that depend on it until you reinstall it.

After closing Terminal tasks that use those tools, remove only the standalone package directory:

sudo rm -rf /Library/Developer/CommandLineTools

Then request a fresh installation and follow the dialog:

xcode-select --install

If macOS says the tools are already installed and will not offer a fresh download, inspect the relevant installed-package receipts before forgetting any. Receipt IDs vary; don't assume com.apple.dt.commandlinetools is a valid ID on your Mac:

pkgutil --pkgs | grep -i CLTools

If a reinstall still fails, use the matching Command Line Tools download from Apple Developer instead of deleting unrelated receipts. Once installed, select and verify the separate tools:

sudo xcode-select --switch /Library/Developer/CommandLineTools

xcode-select -p

You should see /Library/Developer/CommandLineTools. Removing this package does not uninstall the Xcode app.

Check Homebrew and Git afterward

Run these commands if you use Homebrew or Git:

xcode-select -p

git --version

brew doctor

If xcode-select -p still points to a deleted Xcode app, switch it to /Library/Developer/CommandLineTools using the command above. If brew doctor reports a missing or outdated Command Line Tools package, follow its advice; the output may include unrelated warnings even when Xcode removal went smoothly.

The Xcode removal paths are the same on Apple silicon and Intel Macs. Homebrew's usual installation folder differs: /opt/homebrew on Apple silicon and /usr/local on Intel. Run brew --prefix to see where your copy is installed; there's no need to delete or change that folder when removing Xcode.

How to reinstall Xcode after a complete removal

Once all the Xcode files you chose to remove are gone, open the App Store, search for Xcode, and install it again. If you need a particular version, check Apple Developer Downloads. Open Xcode after installation and follow any prompts for additional components; install the Simulator runtimes you actually need.

If you want Terminal to use the new Xcode installation, select it and verify the path:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

xcode-select -p

The second command should return /Applications/Xcode.app/Contents/Developer. Reinstall time depends on the download and any components you select.

Why and when uninstall Xcode?

As we already mentioned, one reason for uninstalling Xcode is that its cache has grown huge. If the app slowed down, it is also a good explanation of why you may want to remove it. But there are some other situations in which you may need to uninstall Xcode: 

  • You no longer need it — you either switched to another tool or stopped developing. 
  • Troubleshooting. Uninstalling can solve all kinds of issues, from Xcode crashing to build errors. 
  • Updating Xcode. Sometimes, if you cannot upgrade Xcode, uninstalling it is an easy way to address the problem.

Whether you want to uninstall Xcode completely or just get rid of old Xcode junk, check which files actually use space before removing them. You can clear build files without deleting the app, or remove Xcode and keep a separate installation of Command Line Tools for Homebrew and Git.

Frequently asked questions

Does uninstalling Xcode remove Command Line Tools?

Removing the app removes the tools inside Xcode. It does not remove a separately installed package in /Library/Developer/CommandLineTools. Check for that package before removing the app.

Can I uninstall Xcode and keep Git and Homebrew?

Yes, as long as you’ve installed the separate Command Line Tools and set your Mac to use them. Check with git --version and brew doctor afterward. Xcode-only commands such as simctl will no longer work.

How do I completely uninstall Xcode?

Remove the app, then review and delete its user data, caches, preferences, and any Simulator devices or runtimes you no longer need. Keep the separate Command Line Tools if you still use Homebrew or Git. Don't delete package receipts just because you removed Xcode.