How do I clear Xcode DerivedData on Mac?
To clear Xcode DerivedData on Mac, GRUJ wipes ~/Library/Developer/Xcode/DerivedData — Xcode's index and intermediate build folder. It's safe: Xcode regenerates it on the next build. Expect 5-50 GB freed. Run gruj clean after scanning and confirming. Your code is never touched.
brew install --cask fan2dev/tap/gruj 3 months free · no card · direct download (outside the App Store)
Why does Xcode fill up my Mac?
Xcode hoards. Every build, every index, every device you ever plugged in leaves artifacts behind, and macOS files most of it under the opaque "System Data" bucket so you can't even see it in Finder. A working iOS dev easily carries 30-60 GB of DerivedData, plus a few GB of old Archives, plus 5-8 GB per stale simulator runtime, plus DeviceSupport for iOS versions you stopped supporting two years ago. None of it is your source — all of it is regenerable. That's exactly the kind of junk GRUJ exists to find and clear.
gruj scan
Scans your Xcode footprint: DerivedData, Archives, simulator runtimes, DeviceSupport, plus SwiftPM and CocoaPods caches. Shows the exact size of each item before you delete anything.
Pick what to clear
Toggle by tool (Xcode) or by type (build, cache, download). Keep your latest Archive for the App Store, drop DerivedData and three simulator runtimes you no longer boot. You decide.
Confirm, then gruj clean
Nothing is deleted until you confirm. GRUJ only removes paths on its regenerable allowlist — never repos, code or data — and reports the GB recovered.
DerivedData
Clears ~/Library/Developer/Xcode/DerivedData, the index and intermediate build store. Typically 30-60 GB on an active project. Xcode rebuilds it on the next compile; the first build after is slower, once.
Archives
Old .xcarchive bundles under ~/Library/Developer/Xcode/Archives pile up with every distribution build. GRUJ lists them by date and size so you keep the one you're shipping and drop the rest.
Simulator runtimes
Each iOS/watchOS/tvOS runtime disk image you no longer boot eats 5-8 GB. By hand that's xcrun simctl runtime delete <id> (or --notUsedSinceDays N); GRUJ finds every runtime, shows its size and clears the ones you pick — a fast, safe win.
DeviceSupport
~/Library/Developer/Xcode/iOS DeviceSupport keeps symbol files for every iOS version you've ever debugged on a real device. Old entries are dead weight; GRUJ surfaces and clears them.
SwiftPM & CocoaPods caches
~/Library/Caches/org.swift.swiftpm and ~/Library/Caches/CocoaPods hold downloaded packages and pods that re-fetch on demand. Included in the same scan, not a separate chore.
Two-axis safety
GRUJ frees space on two axes — by tool (Xcode, Gradle, Flutter, Docker, node) and by type (cache, build, download) — and only ever deletes regenerable paths, never your source.
Manual commands vs GRUJ
| GRUJ | By hand / generic | |
|---|---|---|
| Clear DerivedData | gruj clean — scans, shows size, then deletes on confirm | rm -rf ~/Library/Developer/Xcode/DerivedData |
| See size before deleting | gruj scan shows GB per item up front | du -sh on each path, by hand |
| Delete unused simulator runtimes | Listed by size and cleared in the same scan | xcrun simctl runtime delete --notUsedSinceDays 90 |
| Risk of deleting too much | Low — regenerable-only allowlist, confirm step | High — one wrong path in rm -rf is unforgiving |
| Covers Xcode + Gradle + Docker at once | Yes, one scan across all environments | No — a separate command per tool |
FAQ
Is it safe to clear Xcode DerivedData?
Yes. DerivedData holds Xcode's index and intermediate build files, not your source. Xcode regenerates it automatically on the next build. The only cost is that first rebuild being slower, once.
Where is Xcode DerivedData located?
At ~/Library/Developer/Xcode/DerivedData. The ~/Library folder is hidden in Finder by default — press Cmd+Shift+G and paste the path, or just run gruj scan to see it and its size.
How do I clear Xcode DerivedData on Mac by hand?
Run rm -rf ~/Library/Developer/Xcode/DerivedData in Terminal — it works fine for a one-off. GRUJ adds value by showing the size first, covering Archives, runtimes and DeviceSupport too, and clearing Gradle, Docker and node in the same pass.
How much space does Xcode take on Mac?
On an active iOS project, DerivedData alone is commonly 30-60 GB. Add a few GB of old Archives, 5-8 GB per stale simulator runtime, and DeviceSupport, and Xcode can easily occupy over 50 GB.
How do I delete old iOS simulator runtimes?
Run xcrun simctl runtime delete --notUsedSinceDays 90 to drop runtime disk images you haven't used in 90 days (or delete a specific one with xcrun simctl runtime delete <identifier>). Note: xcrun simctl delete unavailable removes unavailable simulator devices, not runtimes. GRUJ lists every runtime by size and clears the ones you pick in the same scan — each frees roughly 5-8 GB.
What's the best way to clear Xcode caches on Mac?
The safest, fastest way is to scan first, then delete only regenerable paths. By hand: rm -rf ~/Library/Developer/Xcode/DerivedData for DerivedData, plus xcrun simctl runtime delete --notUsedSinceDays N for old runtimes. With GRUJ: gruj scan shows the size of DerivedData, Archives, runtimes, DeviceSupport and SwiftPM/CocoaPods caches in one pass, and gruj clean removes what you confirm — no risk of a mistyped rm -rf.
Will clearing DerivedData delete my project or code?
No. GRUJ only deletes paths on its regenerable allowlist and asks you to confirm first. Your repos, source, certificates and provisioning profiles are never touched.
Reclaim those 50 GB Xcode is hoarding
Scan, see exactly what's eating your disk, confirm, done. Free for 3 months, no card. macOS 13+, Apple Silicon and Intel.
Download free