Xcode taking up too much space on your Mac? What to delete and what to keep

You installed Xcode, built a few apps and now your disk is full. Xcode itself is only part of the problem. The build data, simulators and debug files it creates grow quietly in the background. Here is what each one is and how to clear it without breaking your projects.

Updated · 7 min read

Where Xcode’s space actually goes

The Xcode app in your Applications folder is several gigabytes on its own. That part is fixed. The rest lives in your user Library and grows every time you build, run a simulator or connect a device.

What it isWhere it livesSafe to delete?
DerivedData~/Library/Developer/Xcode/DerivedDataSafe. Xcode rebuilds it on the next build
Simulator devices~/Library/Developer/CoreSimulator/DevicesSafe for devices you don't use
Simulator runtimesXcode Settings, ComponentsSafe for iOS versions you don't test on
iOS DeviceSupport~/Library/Developer/Xcode/iOS DeviceSupportSafe for old iOS versions
Archives~/Library/Developer/Xcode/ArchivesKeep any build you still need to debug
Xcode caches~/Library/Caches/com.apple.dt.XcodeSafe. Quit Xcode first

On macOS, Storage settings counts most of this as Developer or System Data, which is why a grey bar can grow by tens of gigabytes without an obvious cause.

Measure before you delete

Spend a minute finding the biggest folder first. Open Terminal and run:

  • du -sh ~/Library/Developer/Xcode/*
  • du -sh ~/Library/Developer/CoreSimulator

Each line shows a folder and its size. Start your cleanup with whichever is largest. You can also open ~/Library/Developer in Finder with Shift-Command-G and turn on Calculate all sizes in View Options.

6 ways to free up space from Xcode

Quit Xcode and the Simulator app before you start.

1. Delete DerivedData

DerivedData holds the build products, indexes and logs for every project you have ever opened. Projects you deleted months ago still have folders here.

  1. In Finder, press Shift-Command-G and go to ~/Library/Developer/Xcode/DerivedData.
  2. Select everything inside and move it to the Trash.
  3. Empty the Trash.

Xcode recreates what it needs on your next build, which takes longer than usual once. For a single project, Product, then Clean Build Folder, is the gentler option, though it frees less.

2. Remove simulators you don’t use

Every simulator device keeps its own apps and data. Old devices from past Xcode versions often linger after their runtime is gone.

  1. In Terminal, run xcrun simctl delete unavailable. This removes devices whose runtime is no longer installed.
  2. For the rest, open Xcode, choose Window, then Devices and Simulators, click Simulators, right-click a device you don’t use and choose Delete.

Reset rather than delete

If a simulator you still use has grown large, reset it instead. Run xcrun simctl erase all to wipe the data on every simulator while keeping the devices themselves.

3. Remove old simulator runtimes

Runtimes are the biggest single items, often several gigabytes each. You need one only for the iOS, watchOS, tvOS or visionOS versions you actually test on.

  1. Open Xcode, choose Xcode, then Settings, then Components. Older versions call this tab Platforms.
  2. Select a runtime you no longer need.
  3. Click the minus button and confirm.

From Terminal, xcrun simctl runtime list shows installed runtimes with their IDs, and xcrun simctl runtime delete followed by an ID removes one. Some runtimes disappear only after a restart, so check again after you reboot.

4. Clear old iOS DeviceSupport files

Each time you connect an iPhone running a new iOS version, Xcode copies debug symbols for it. Over a few years you can collect a folder for every point release you ever ran.

Go to ~/Library/Developer/Xcode/iOS DeviceSupport and delete folders for iOS versions your devices no longer use. Keep the newest. Xcode recreates any folder it needs when you next connect a device. The same applies to the watchOS DeviceSupport folder if you have one.

5. Prune old archives

Every time you archive a build to upload or export it, Xcode keeps a copy, debug symbols included. Open Xcode, choose Window, then Organizer, and review the Archives list. Delete builds for versions you no longer support. Read the next section first.

6. Clear Xcode and Swift package caches

Xcode keeps a general cache at ~/Library/Caches/com.apple.dt.Xcode, and Swift Package Manager keeps downloaded packages at ~/Library/Caches/org.swift.swiftpm. Both are safe to empty with Xcode closed. Packages download again the next time a project resolves them.

The Storage settings shortcut

macOS also offers a quick route. Open System Settings, then General, then Storage, and click the info button next to Developer. It lists Xcode caches, build files and some simulator data with their sizes, and you can delete them from there. It doesn’t show archives or runtimes, so use the steps above for a full cleanup.

What to keep, even when space is tight

Archives for live releases

An archive holds the dSYM files that turn crash reports into readable stack traces. If users still run a version, keep its archive, or export its dSYMs somewhere safe first.

The runtime for your deployment target

Keep at least one runtime that matches the oldest iOS version you support, plus the current one. Without them, you can’t test the versions your users run.

Anything inside /System or /Library you didn’t create

Some simulator runtimes live in protected system folders. Remove them through Xcode or simctl, never by deleting folders with administrator rights. Forcing it can leave Xcode unable to find the runtimes you kept.

If something breaks after a cleanup

None of the steps above touch your source code, but a few things can look odd the first time you open Xcode.

The first build is slow

That is expected after you clear DerivedData. Xcode rebuilds every module and reindexes the project once. Later builds return to normal speed.

Autocomplete or jump-to-definition stops working

Indexing runs in the background after a cleanup. Give it a few minutes. If it stays broken, quit Xcode, clear DerivedData for that project again and reopen it.

A simulator you need has gone

Open Xcode, then Settings, then Components, and download the runtime again. Then add a device in Devices and Simulators. Your project and its code are unaffected.

Packages fail to resolve

Choose File, then Packages, then Reset Package Caches, and let Xcode download them again.

Do you have more than one copy of Xcode?

Beta testers often keep a release Xcode and a beta side by side. Each copy is several gigabytes, and each one downloads its own components. Check Applications for apps named Xcode-beta or with a version number, and delete the ones you have finished with.

If you also work on web projects, look for old node_modules folders too. Projects you haven’t touched in months can hold hundreds of megabytes each, and npm install brings them back whenever you need them.

Keep Xcode lean from now on

  • Clear DerivedData every month or two, and whenever builds act strangely.
  • Remove the previous runtime once you drop support for that iOS version.
  • Run xcrun simctl delete unavailable after every major Xcode update.
  • Review the Organizer when you ship a release and drop archives you no longer need.

If Xcode isn’t the whole story, our guide on how to free up space on a Mac covers the rest of the disk.

Clean developer files in one scan with MyMacStorage

MyMacStorage has a Developer files tool built for this job. It scans locally, so your project names never leave your Mac, and it moves everything to the Trash rather than deleting it. It costs $14.99 once, with no subscription. Learn more on the home page.

Your questions, answered.

Why is Xcode taking up so much space on my Mac?

Xcode itself is large, but most of the space goes to files it creates as you work: DerivedData from every build, simulator runtimes for each iOS version, device support files for every iPhone you connect and archives of every release you ship.

Is it safe to delete DerivedData?

Yes. DerivedData holds build products and indexes that Xcode recreates. Quit Xcode, delete the folder's contents, and expect the next build of each project to take longer than usual.

Can I delete the whole CoreSimulator folder?

It is better not to. Delete unused simulator devices and runtimes through Xcode or simctl instead. That way Xcode's own records stay in step with what is on disk.

Should I delete old Xcode archives?

Only for builds you no longer support. An archive holds the debug symbols you need to read crash reports from that version. If users still run a build, keep its archive.

What is iOS DeviceSupport, and can I delete it?

Xcode creates a folder of debug symbols for each iOS version it sees on a connected device. Folders for iOS versions your devices no longer run are safe to delete. Xcode recreates one the next time you connect a device on that version.

Why did a simulator runtime come back after I deleted it?

Some runtimes are managed by macOS as system assets, and removal can take effect only after a restart. If one keeps returning, check Xcode Settings, then Components, after restarting, and avoid deleting protected system folders by hand.

Give your Mac room to breathe.

Clear build data, simulators and node_modules in one place. $14.99 once, with a 7-day refund.