Xcode · free up space

How to uninstall Xcode on a Mac

Copy ~/Library/Developer/Xcode/Archives somewhere safe, remove the simulator runtimes you no longer need in Xcode → Settings → Components while Xcode is still installed, then quit Xcode, drag it from Applications to the Trash and empty the Trash. The app is only part of it: its build output, device support files and simulators stay in ~/Library/Developer until you remove them.

Before you start: what goes with it

  • Archives. Each archive holds the builds of an app you distributed and their dSYM symbol files. Apple's documentation is firm: you must keep the archive for each build you distribute, because without it you might not be able to diagnose an issue from a crash report. Nothing can rebuild an old archive. Copy ~/Library/Developer/Xcode/Archives to another drive before anything else.
  • Simulators. Each simulated device holds the apps installed in it and their data. A new device can be made again; what was inside the old one does not come back.
  • Simulator runtimes. Each is a copy of iOS, watchOS or another platform for the simulator. Xcode can download them again, which is the whole cost.
  • Your projects are wherever you saved them, not inside Xcode, and none of these steps touch them.

First, while Xcode is still installed

The tool that removes simulators and their runtimes, simctl, lives inside the Xcode app. So does the Components pane. Remove these first; afterwards there is nothing left to remove them with.

  1. Runtimes. Choose Xcode → Settings and click Components. Apple's documentation describes it: Xcode shows each installed component with the space you recover by removing it. Click the information button next to a runtime under Other Installed Platforms, then Delete. To list them from Terminal instead:
xcrun simctl runtime list
  1. Simulated devices. The first line lists them; the second deletes every one of them, with the apps and data inside, so run it only once you are sure:
xcrun simctl list devices
xcrun simctl delete all

How to delete old iOS simulator runtimes has the commands for removing them one at a time.

Removing the app

Xcode is an ordinary app as far as removing it goes. Apple's steps:

  1. Quit Xcode, and the Simulator if it is open.
  2. Open Finder and go to Applications.
  3. Drag Xcode to the Trash, entering an administrator name and password if asked.
  4. Choose Finder → Empty Trash. Nothing is freed until you do.

What it leaves in ~/Library/Developer

Xcode keeps its working files outside the app, in ~/Library/Developer, and the Trash does not touch them. To see what is there and how big each part is:

du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator 2>/dev/null | sort -h
  • Xcode/DerivedData — build output and indexes, one folder per project. Safe to delete; see where DerivedData lives.
  • Xcode/Archives — the archives above. Delete only once they are copied somewhere safe.
  • Xcode/iOS DeviceSupport — symbol files copied from each iPhone you connected, with watchOS, tvOS and visionOS folders beside it if you used those devices.
  • Xcode/UserData — what Xcode keeps for you, such as key bindings and provisioning profiles, and the simulators SwiftUI previews made, in Previews.
  • CoreSimulator — the simulated devices and their data.
  • Packages — hardware support updates downloaded with xcodebuild -checkForNewerComponents, if you ever ran it.

To remove them, press Shift-Command-G in Finder, paste ~/Library/Developer, and drag the folders you no longer want to the Trash. If you will never install Xcode again, that can be all of them except a copy of your archives. Use the Trash rather than rm -rf, which deletes outright with no undo.

The Command Line Tools are separate

The Command Line Tools, installed with xcode-select --install, live in /Library/Developer/CommandLineTools, outside the Xcode app, so dragging Xcode to the Trash leaves them in place. To see which developer folder Terminal's tools, such as xcrun and cc, are using:

xcode-select -p

If that still names the Xcode you have deleted, this unsets the choice so the tools look for a developer folder the default way. It asks for your password and applies to every user on the Mac:

sudo xcode-select --reset

If you are coming back to Xcode

If the aim is space rather than getting rid of Xcode, uninstalling is the long way round: the app itself is one large download to come back, and the folders above, which are often where the space is, can be cleared with Xcode still installed.

Where the app comes in

RefreshYourMac measures what Xcode leaves in separate categories, each with its own safety level, and a scheduled clean skips the ones Xcode holds open while Xcode is running. Xcode Derived Data, iOS Device Support (the iOS, watchOS, tvOS and visionOS folders), iPhone Support Caches and SwiftUI Previews are rated Safe for auto removal: each is made again by Xcode when it is next needed. Xcode Simulators and Simulator Runtimes are rated Review before deleting, and are removed through simctl, the same tool as above, which means running them before Xcode goes. Simulator Shared Cache, the simulator's library cache in /Library/Developer/CoreSimulator/Caches/dyld, is root-owned, so macOS asks for your password. Xcode Archives is rated Backup recommended: the app says they may be App Store submissions whose dSYMs are needed to read crash reports, and suggests moving old ones to another drive rather than deleting them; anything you do remove goes to the Trash.

The Mac App Store edition has Xcode Derived Data, iOS Device Support, SwiftUI Previews and Xcode Archives; the simulator categories and iPhone Support Caches are in the download edition only. So is Uninstall an App, described in how to uninstall apps on a Mac. It refuses Apple's own apps, with Xcode the one exception, and finds the app's preferences, caches and other pieces by bundle ID; it does not look in ~/Library/Developer, so clean the categories above first. For the rest of what development tools leave on a Mac, see the Mac cleaner for developers.

What to do next: see these numbers for your own Mac. Download RefreshYourMac free, or get it on the Mac App Store.

What it costs to have an app do this

RefreshYourMacCleanMyMacMacKeeper
Pay once$24.99€119.95 on MacPaw’s store; $89.99 for CleanMyMac X on the Mac App Storesubscription only
Yearly$14.99 a year, first 7 days free$39.99/yr; €19.91/yr for the cleaning-only Essential Trio€71.40 for the first year, 1 Mac. Their page shows it against a €119.40 list price
Monthly$1.99 a month$9.99/mo€10.95/mo
Account neededNoYesYes

Before you pay anything, both versions give you 3 free scans. CleanMyMac and MacKeeper prices read from their own pages and the Mac App Store on 27 October 2026; the full comparison is at RefreshYourMac vs CleanMyMac and MacKeeper.

Frequently asked questions

Does deleting Xcode remove simulators and DerivedData?

No. Dragging Xcode to the Trash removes the app only. DerivedData, archives, device support files and simulated devices stay in ~/Library/Developer until you remove them, and simulator runtimes are best removed in Xcode → Settings → Components before the app goes.

Why remove simulator runtimes before uninstalling Xcode?

The tools that remove them, the Components settings and simctl, are part of the Xcode app. Once Xcode is gone there is nothing left to remove them with, so delete the runtimes and simulated devices you no longer need first.

Should I keep my Xcode archives?

Yes, for any build you distributed. Apple’s documentation says to keep the archive for each build you distribute, because its dSYM files are needed to diagnose crash reports. Copy ~/Library/Developer/Xcode/Archives to another drive before removing anything.

Does uninstalling Xcode remove the Command Line Tools?

No. They live in /Library/Developer/CommandLineTools, outside the Xcode app. If xcode-select -p still names the Xcode you deleted, sudo xcode-select --reset unsets that choice so the tools find a developer folder the default way.