To clear Xcode's cache, delete the contents of ~/Library/Developer/Xcode/DerivedData, trim old iOS DeviceSupport versions, and remove archives you no longer need — Xcode regenerates whatever it still requires on the next build. It is common for Xcode alone to hold 50–100 GB of a developer's Mac.
TL;DR
- Xcode scatters tens of gigabytes across hidden
~/Library/Developer/Xcodefolders. - Derived Data is the biggest, fastest win and is always safe to delete.
- iOS DeviceSupport holds debug symbols for every iOS version you've ever tested.
- Archives are your shipped
.xcarchivebuilds — keep only what's not yet uploaded. - Nothing breaks: builds just take slightly longer once while indexes rebuild.
Where does Xcode's storage actually go?
Xcode's footprint lives in a few hidden folders under ~/Library/Developer/Xcode. The three that matter:
| Folder | Contents | Safe to delete? |
|---|---|---|
DerivedData |
Intermediate build results and code indexes | Yes — always |
iOS DeviceSupport |
Debug symbols per iOS version you've used | Yes — old versions |
Archives |
Shipped .xcarchive builds |
Only after upload |
Derived Data is the first place to look because Xcode rarely cleans it between projects or branch switches, so it grows unchecked across every repo you've ever opened.
How do I clear Xcode Derived Data?
Derived Data holds intermediate build output and indexes that Xcode rebuilds automatically, so emptying it is the safest and biggest single win:
- Open Finder.
- Press Command + Shift + G.
- Paste
~/Library/Developer/Xcode/DerivedDataand press Return. - Select everything inside (Command + A) and move it to the Trash.
- Empty the Trash.
The next build runs slightly slower while Xcode rebuilds indexes, but nothing breaks and no source code is touched. You can also clear it from within Xcode via Xcode › Settings › Locations, but the Finder route reclaims space immediately.
How do I trim Device Support and Archives?
If Derived Data is clean and Xcode is still huge, these two folders are next:
iOS DeviceSupportstores debug symbols for every iOS version you have ever debugged against. Open~/Library/Developer/Xcode/iOS DeviceSupportand remove folders for OS versions you no longer test — Xcode re-downloads them if a device on that version connects again.Archiveskeeps your distributed.xcarchivebuilds. Open~/Library/Developer/Xcode/Archivesand remove archives already uploaded to App Store Connect. Keep any archive you still need for crash symbolication (dSYMs).
For a visual breakdown, DevCleaner for Xcode (free on the Mac App Store) lists all three categories and clears them in one pass.
Is it safe to delete these Xcode files?
Yes. Derived Data and old Device Support folders are fully regenerable — Xcode rebuilds Derived Data on the next build and re-downloads Device Support when a device connects, so deleting them never harms your source code or projects. The one caution is Archives: keep any .xcarchive whose dSYM you might need to symbolicate crash reports from a released build. Your source files, Git history, and project settings are never stored in these caches and are unaffected.
What else eats Mac storage for developers?
Xcode is rarely the only offender on a developer's Mac — media tools and "System Data" often hide just as much. If Xcode wasn't the source of your bloat, continue here:
- Mysterious System Data on Mac: how to safely clean the disk
- How to clear Adobe Premiere / After Effects media cache
- How to clear the Final Cut Pro media cache
- How to delete old iMovie projects
For a structured approach to reclaiming storage across your devices, see the storage cleanup hub.
FAQ
Is it safe to delete the DerivedData folder?
Yes. DerivedData contains only intermediate build files and code indexes, which Xcode regenerates on the next build. Deleting it never affects your source code or project settings.
Will deleting Derived Data break my project?
No. Your project will rebuild from source the next time you build; the only effect is a one-time slower build while indexes regenerate.
How much space can clearing Xcode free?
Frequently 20–100 GB. Derived Data, iOS Device Support, and old archives accumulate steadily across projects and OS versions without automatic cleanup.
Can I delete iOS Device Support folders?
Yes. Remove folders for iOS versions you no longer debug. Xcode re-downloads support files automatically if a device on that version connects again.
Should I delete Xcode archives?
Only archives already uploaded to App Store Connect. Keep any .xcarchive whose dSYM you may need to symbolicate crash reports from a shipped build.
Keep your devices clean, not just your Mac
Clearing Xcode caches frees gigabytes on your Mac. For the iPhone in your pocket, Cleanor for iPhone does the same kind of cleanup — finding duplicates, large videos, and clutter locally, with nothing ever uploaded off your device.