← Back to Blog

How I reclaim the space of my Mac's storage

2021-07-24·2 min read
SwiftiOSmacOSTestingNetworkingAI / MLTutorial

I use XCode and iOS simulator daily and this is what I do to get back some storage space on my Mac other than doing what's mentioned in Apple Support site.

For every path I mention below, I'll remove the content in that folder. To go to every path, you can open Finder, and press CMD + SHIFT + G and paste it.

1. Derived Data

~/Library/Developer/Xcode/DerivedData
Derived data contains intermediate build information that's generated from each build process. Delete this folder after every few days interval. Most of the time, it occupy huge space!

2. Archives

~/Library/Developer/Xcode/Archives
All your targets are kept in the archived form in Archives folder. These are created every time you archive your app and it can take up huge space depending on your app size multiplied by how many times you archived it. Before you decide to delete the contents of this folder, here’s a warning that if you want to be able to debug deployed versions of your app, you shouldn’t delete the archives. Because you might need the debug symbol(.dSYM) file to re-symbolicate your crash reports.

3. iOS Device Support

~/Library/Developer/Xcode/iOS DeviceSupport
iOS Device Support folder creates a subfolder with the device version as an identifier when you attach the device. Most of the time it’s just old stuff. Keep the latest version and rest of them can be deleted (if you don’t have an app that runs on 5.1.1, there’s no reason to keep the 5.1.1 directory/directories).

4. Core Simulator

~/Library/Developer/CoreSimulator
Core Simulator folder is familiar for many Xcode users. It’s simulator’s territory; that's where it stores app data. It’s obvious that you can toss the older version simulator folder/folders if you no longer support your apps for those versions. And, it’s safer to use ‘Reset Content and Settings’ option from the menu to delete all of your app data in a Simulator.

5. Caches

~/Library/Caches/com.apple.dt.Xcode
Caches are always safe to delete since they will be recreated as necessary. This isn’t a directory; it’s a file of kind Xcode Project. Delete away!

6. Backup

~/Library/Application Support/MobileSync/Backup
Additionally, Apple iOS device automatically syncs specific files and settings to your Mac every time they are connected to your Mac machine. To be on safe side, it’s wise to use Devices pane of iTunes preferences to delete older backups; you should be retaining your most recent back-ups off course.

7. Remove all simulators Xcode no longer requires

Open terminal and run $ xcrun simctl delete unavailable
This command will remove all the simulators that Xcode no longer requires.

Last, empty your trash.
If you happen to know a better way, let me know. Thanks for reading!

References: