How to free up space from Xcode and iOS simulators
Xcode is the biggest source of lost space on a developer Mac. Each simulator runtime takes 8 to 18 GB, and they stay even after you uninstall Xcode. A real case: ~23 GB of runtimes from an Xcode that wasn't installed anymore.
DerivedData: always safe
SafeThese are intermediate build files. Xcode recreates them on the next build.
rm -rf ~/Library/Developer/Xcode/DerivedData/*Simulators that no longer work
SafeThis command deletes simulators for iOS versions you no longer have installed. The ones you use aren't touched:
xcrun simctl delete unavailableOld iOS runtimes
Regenerates, with a costList your runtimes and delete the versions you no longer test on. Use Xcode's command: deleting them by hand doesn't work because they're mounted disk images protected by the system.
xcrun simctl runtime listxcrun simctl runtime delete <ID>Finder and du can report up to 4× the real size for these folders, because they count the contents of the mounted disk images.
iOS DeviceSupport
SafeEvery time you connect an iPhone running a new iOS version, Xcode stores 2–5 GB of symbols in ~/Library/Developer/Xcode/iOS DeviceSupport. Delete old versions; Xcode downloads them again if you connect that device.
Archives: careful
Your files: review~/Library/Developer/Xcode/Archives stores your shipped builds with their symbols (dSYM). You need them to symbolicate crash reports for those versions. Only delete the ones for versions nobody uses anymore.
FAQ
If I use Expo or React Native, do I need the simulators?
Yes, you need at least one recent iOS runtime to test in the simulator. Delete only the ones you don't use and the "unavailable" ones.
Keep reading
Free up Android Studio space without breaking Expo or React Native
The Android SDK, emulators and Gradle can take 20–40 GB. What you can delete and what Expo needs to keep working.
How to find and delete old node_modules on Mac
Find every node_modules folder on your Mac, sort them by size and delete the ones from inactive projects. They reinstall with one command.
What is "System Data" on Mac and how do you shrink it?
Why "System Data" (formerly "Other") takes so much space on your Mac, what's inside it and what you can safely delete.