See Your Disk

Home / Guides / How to Clear Xcode DerivedData and Free Space on Mac

How to clear Xcode DerivedData (and other Xcode leftovers) on Mac

Updated 2026-10-21

Quick answer: quit Xcode, then delete ~/Library/Developer/Xcode/DerivedData. Xcode recreates it on the next build. It is the safest and usually the biggest Xcode cleanup.

What DerivedData is

Every time you build, Xcode stores compiled products, indexes, build logs and intermediate files in DerivedData, one subfolder per project. On an active machine with several projects it grows steadily, and it is never cleaned up automatically. Because Xcode can regenerate all of it, it is the first thing to remove.

Delete it

From Xcode: open Settings → Locations, click the small arrow next to the Derived Data path to reveal it in Finder, quit Xcode and move the folders to the Trash. Or in Terminal:

rm -rf ~/Library/Developer/Xcode/DerivedData

Expect the first build and the first indexing afterwards to take longer than usual.

See how much Xcode is using

du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator 2>/dev/null

On a lightly used test Mac this showed DerivedData at 391 MB, iOS DeviceSupport at 555 MB and CoreSimulator at 2.8 GB. On a Mac that builds large apps every day each of them can be many times bigger.

The other Xcode folders and what to do with each

FolderWhat it isSafe to delete?
~/Library/Developer/Xcode/DerivedDataBuild products, indexes and logsYes. Rebuilt on the next build
~/Library/Developer/Xcode/iOS DeviceSupport (also watchOS and tvOS)Debug symbols copied from devices you connectedYes. Copied again when you reconnect the device
~/Library/Developer/Xcode/ArchivesArchived builds with their dSYM filesOnly the ones you no longer need to submit or symbolicate
~/Library/Developer/CoreSimulator/DevicesSimulator devices with their apps and dataDelete unused devices. Apps inside lose their data
~/Library/Developer/CoreSimulator/CachesSimulator cachesYes
~/Library/Caches/org.swift.swiftpmSwift Package Manager cacheYes. Packages are fetched again
~/Library/Caches/CocoaPodsCocoaPods cacheYes. Or run pod cache clean --all

Old simulators and runtimes

Simulators are often the second biggest item. This removes simulator devices that the installed Xcode can no longer use:

xcrun simctl delete unavailable

Simulator runtimes (the downloadable iOS, watchOS and tvOS images) are usually several gigabytes each. List them, then preview what a cleanup would remove before you delete anything:

xcrun simctl runtime list
xcrun simctl runtime delete --notUsedSinceDays 30 --dry-run

If the preview looks right, run the same command without --dry-run. You can also remove runtimes in Xcode under Settings → Components (called Platforms in some earlier versions).

What not to do

  • Do not delete the whole ~/Library/Developer folder. It also holds things you may want, such as your Archives.
  • Do not delete Archives without checking that you will never need their dSYM files again.
  • Do not run rm -rf with sudo on any of these paths. None of them needs administrator rights.
  • Quit Xcode and the Simulator before deleting.

Let a tool sort it for you

See Your Disk shows these folders on a map and marks DerivedData, device support files and simulator caches as Safe, while Archives and simulator devices are marked Review. See how it decides and the wider System Data cleanup guide.

See Your Disk
A map of your Mac's disk, and a safe way to clean it.

Frequently asked questions

Is it safe to delete DerivedData?

Yes. DerivedData only holds build products, indexes and logs that Xcode creates again the next time you build. Quit Xcode first. The first build afterwards is slower because everything is rebuilt.

Will deleting DerivedData fix Xcode build errors?

Often it fixes problems caused by stale build products or a stale index, which is why it is a common first step. Product, Clean Build Folder (Shift-Command-K) is the milder version of the same idea. Neither is guaranteed to fix every error.

Can I delete the iOS DeviceSupport folder?

Yes. It holds debug symbols that Xcode copies from a device the first time you connect it with a given OS version. Xcode copies them again when you reconnect, which takes a few minutes.

Which Xcode folder should I never delete without checking?

Archives. It contains your archived builds including their dSYM files, which you need to symbolicate crash reports for versions already released. Remove only archives you will never need again.

Related guides