All guides

Developer

How to delete Xcode DerivedData safely on a Mac

Xcode can quietly take tens of gigabytes. DerivedData is the safe part to clear. Here is what each folder holds and what to keep.

Is it safe to delete DerivedData?

Yes. DerivedData holds build products, indexes and logs that Xcode creates while it compiles. Xcode rebuilds it the next time you build, so deleting it costs you only a slower first build. It is the first place to look when Xcode is using a lot of space or behaving strangely after an update.

Where it is

By default it is at ~/Library/Developer/Xcode/DerivedData. In Xcode, open Settings, then Locations, to see the path and open it in Finder. Quit Xcode first.

How to clear it

  1. Quit Xcode.
  2. In Finder choose Go, then Go to Folder, and paste the path above.
  3. Move the project folders inside to the Trash, or from Terminal run rm -rf ~/Library/Developer/Xcode/DerivedData.
  4. Open your project and build. The first build is slower while Xcode recreates the index.

What else Xcode piles up

FolderSafe to delete?Notes
DerivedDataYesRebuilt on the next build.
iOS DeviceSupportMostlySymbols copied from devices you connected. Re-created when you connect them again.
ArchivesCarefulYour shipped builds. You may need them to symbolicate crash reports. Keep releases you still support.
CoreSimulator devicesPartlyRemove unused simulators; this also removes their app data.

Clear unused simulators

Run xcrun simctl delete unavailable to remove simulators for runtimes you no longer have. In Xcode, Settings and then Platforms lets you remove simulator runtimes you do not use.

A careful approach

  1. Look at the sizes first, so you know what is worth clearing.
  2. Start with DerivedData, then DeviceSupport, then unused simulators.
  3. Leave Archives for releases you may need to debug.
  4. Move items to the Trash rather than deleting permanently.

sysZivo’s Xcode developer filter finds these folders for you and shows their sizes on the storage map, so you can decide with the numbers in front of you. See also cleaning node_modules and Docker cache and what System Data is.

Questions people ask

Is it safe to delete Xcode DerivedData?

Yes. Xcode rebuilds it on the next build. Quit Xcode first. The only cost is a slower first build.

Where is DerivedData on a Mac?

At ~/Library/Developer/Xcode/DerivedData by default. Xcode Settings, then Locations, shows the path.

Can I delete Xcode Archives?

Only the ones you no longer need. Archives hold shipped builds and are useful for crash symbolication.

Try it on your Mac

Free to scan and explore. Cleaning needs Pro: €19.99 a year, or a 14-day trial for €1.

Download for Mac

Original writing by the sysZivo team. Apple, macOS, Mac, MacBook, Xcode and Time Machine belong to Apple Inc. Docker, Node.js and npm belong to their owners and are named only to describe compatibility. sysZivo is not affiliated with or endorsed by them. See Brand & trademarks.