Safe to Delete

Xcode DerivedData Folder (~/Library/Developer/Xcode/DerivedData)

Quick Answer: DerivedData stores Xcode build indexes, intermediate object files, and module caches. Deleting it is safe and is a standard fix for Xcode build bugs.

Bottom Line: It is 100% safe to delete the DerivedData folder. Deleting DerivedData is actually the most famous troubleshooting step among iOS and Mac developers to fix weird Xcode compilation bugs, indexing errors, and build hangs.


What is the Xcode DerivedData Folder?

Located at ~/Library/Developer/Xcode/DerivedData on macOS, DerivedData is the directory where Apple’s Xcode IDE stores intermediate build artifacts, module caches, pre-compiled headers, and index databases for all your Swift/Objective-C projects.

To make building faster, Xcode caches everything. However, as you modify code, update dependencies (CocoaPods, Swift Package Manager), or switch branches, old build artifacts remain stored in DerivedData. A busy Mac developer’s DerivedData folder easily grows to 20 GB to 50 GB+.


Can You Delete DerivedData?

✅ Yes, it is completely safe to delete.

  • Zero project loss: Your Swift code, Xcode project files (.xcodeproj), and assets remain untouched.
  • Auto-rebuilds: The next time you open a project in Xcode and press Cmd + B, Xcode will regenerate the build index and compile clean artifacts.

How to Safely Clean Up Xcode DerivedData

Method 1: Delete via Terminal (Fastest)

Open Terminal on your Mac and run:

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

Method 2: Delete via Xcode Settings

  1. Open Xcode.
  2. Go to Xcode > Settings (or Cmd + ,).
  3. Click the Locations tab.
  4. Next to the Derived Data path, click the small arrow icon to open the folder in Finder.
  5. Move the folders inside DerivedData to Trash and empty Trash.

Method 3: Use DevCleaner for Xcode (Free App Store Utility)

DevCleaner for Xcode is a free Mac App Store tool that lets you selectively clean old derived data, device logs, and old iOS simulator caches with a single click.


Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files