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
- Open Xcode.
- Go to Xcode > Settings (or
Cmd + ,). - Click the Locations tab.
- Next to the Derived Data path, click the small arrow icon to open the folder in Finder.
- Move the folders inside
DerivedDatato 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.
Related Guides
- Learn about deleting macOS ~/Library/Caches.
- How to clean up iOS Update Files.
- Check if you can delete MobileSync Backups.
Discussion
Loading authentication...