r/iOSProgramming • u/ruprechttmb • Oct 19 '26
Discussion what's the biggest thing xcode is hoarding on your mac? deriveddata, simulators, device support?
was cleaning up my mac and a surprising chunk of it was xcode stuff i didn't need anymore. the usual suspects for me were ~/Library/Developer/Xcode/DerivedData which is safe to delete and just rebuilds next time you build, old simulators where xcrun simctl delete unavailable clears out the ones for runtimes you don't have anymore, and ~/Library/Developer/Xcode/iOS DeviceSupport which quietly keeps a copy for every ios version you've ever plugged a phone in with
the one i'd be careful with is ~/Library/Developer/Xcode/Archives, you need those to symbolicate crash reports from builds you actually shipped, so i only clear out old ones for apps i'm not supporting anymore
to see what you've got: du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator 2>/dev/null
drop your biggest number, and curious what people do about it, anyone automating this or do you just nuke deriveddata when xcode starts acting weird
10
u/Successful-Tax1306 Oct 19 '26
For me it was old simulator runtimes, way more than DerivedData. Every Xcode update left the previous iOS runtimes behind and I didn't notice until the disk was almost full.
xcrun simctl runtime listshows what you have, and you can remove old ones withxcrun simctl runtime deleteor from the Platforms tab in Xcode settings, which felt safer the first time. I don't automate it, I just check that list after each major Xcode update and keep the current runtime plus one older one for testing.4
u/jacobs-tech-tavern Oct 19 '26
Dude, with Agentic Engineering, I've got 10 separate checkouts of our main monorepo, and each one has its own simulator. And yeah, between derived data and simulators, they seem to accumulate 40 gigabytes each every couple of weeks, and I have to go and cull it all the time.
3
u/dawedev Oct 20 '26
The du in the post misses the biggest one for a lot of people: since Xcode 15 the simulator runtimes are disk images managed by the system, outside your home folder, so
duon ~/Library doesn't count them at all.xcrun simctl runtime listshows what you have.Two more that hide inside its totals:
~/Library/Developer/CoreSimulator/Cacheskeeps a dyld cache per runtime and can reach several GB. It's safe to delete, the simulator rebuilds it on the next boot (that's the slow first launch).~/Library/Developer/Xcode/UserData/Previewshas its own set of simulator devices that grows separately from the main ones.3
u/cristi_baluta Oct 19 '26
We clear them regularly, this is a well known fact that xcode is keeping all the useless trash there
3
u/Tarantino133 Oct 19 '26
Just checked mine: DerivedData 14 GB, simulator devices 12 GB, Archives under 1 GB. So DerivedData wins, and luckily it's the one you can delete without thinking.
3
u/Evening_Respect_6611 Oct 19 '26
on expo projects its the project folders more than xcode itself. if u run agents in separate worktrees every checkout gets its own node_modules and ios/Pods, and those add up way faster than deriveddata. since expo prebuild regenerates the ios folder anyway u can just delete it plus node_modules on worktrees ur done with. ~/Library/Caches/CocoaPods is another sneaky one
3
u/BabyJourney110 Oct 21 '26
Old Simulators. Just delete them
3
u/Cause-n-effect11 Oct 19 '26
About 80 GB worth of similulators and older sdk. I support iOS 18+ and Apple Watch, iPad and iPhone. My 1TB MacBook constantly goes under 10GB free when using multiple agents that like to worktree.
3
u/jaymakesapps Oct 19 '26
DeviceSupport keeping a copy for every iOS version you ever plugged a phone in with is the sneaky one, nobody thinks to look there. I just nuke DerivedData whenever Xcode starts acting weird and call it maintenance lol
1
u/Designer_Age7745 28d ago
I measured 30.5 GiB across 53 simulator device folders on my Mac during QA this week. One device’s data folder accounted for 9.81 GiB, but its app containers were only 0.34 GiB. The larger directories included Lock Screen poster snapshots, logs and downloaded assets.
These are device data folders under ~/Library/Developer/CoreSimulator/Devices, separate from the installed runtimes. Four simulators were running during the measurement, so this wasn’t an idle baseline.
Disclosure: I build StorageRadar; these numbers came from investigating disk usage on my development Mac.