Back to Storage Guides
Developer Guide• 4 min read

How to Safely Delete Xcode DerivedData and Reclaim 30+ GB

If you develop iOS or macOS apps, your disk space is likely disappearing into a directory called DerivedData. Here is why it grows so large, what happens when you purge it, and how to do it safely.

What is Xcode DerivedData?

Whenever you build, test, or index a project in Xcode, macOS stores intermediate compilation objects, precompiled headers, Swift module caches, and index stores in:

DerivedData Path
~/Library/Developer/Xcode/DerivedData

For active developers working on multiple branches or dependencies (Swift Packages, CocoaPods), this single directory frequently explodes to 30 GB to 100 GB.

Is It Safe to Delete?

Yes, 100% safe. DerivedData does not contain your source code, Git commits, or project settings. It contains only cached compilation outputs.

The only consequence:The next time you open and compile a project in Xcode, it will rebuild from scratch and re-index. The initial build may take 1–2 minutes longer.

Method 1: Safe Automatic Cleanup with DiskWarren

Instead of navigating hidden Library directories or writing risky terminal scripts, DiskWarren automatically detects Xcode DerivedData, simulator device logs, and old archive symbols:

  1. Launch DiskWarren.
  2. Click Developer Storage Intelligence.
  3. Review the exact size and age of your DerivedData folder.
  4. Click Move to Trash. Items are safely recycled, giving you instant Put Back protection.

Method 2: Manual Deletion via Terminal

If you prefer manual deletion, close Xcode first, then run:

Terminal Command
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Caution: Running rm -rf permanently deletes files without placing them in the macOS Trash.

Clean Xcode & Developer Caches Safely

Download DiskWarren for macOS • 100% Native & Private

Get Free App