Free up 20GB of space in 20 minutes

Quick ways to free space on your Xamarin Mac computer

A Xamarin Developer’s Scroll

Are you also trying to update to to the latest MacOS or XCode , but there’s no space on your MacBook Pro? Did you also think you would get by with the 128/256 GB SSD, but then you find out the “7GB” XCode unpacks into 20GB? I am sure you already tried to fiddle with the Storage Management , but it wasn’t much help, and now you are wondering if it’s time to buy another Mac.

Common error when trying to update XCode

Not yet partner! Your MacBook still has many years on it, and now’s not the time to give up! Mac computers are expensive for a reason. There’s still several ways to save space, and I have collected the quickest steps that saved me >1GB (up to 5GB) each, and split this article into Xamarin, iOS, Android & Other Resources. Important points to keep in mind:

The “ ~ ” sign used in this article refers to the User folder that holds the Documents and Downloads folders, or “ Users/saamer/ ” in my case.

” sign used in this article refers to the User folder that holds the Documents and Downloads folders, or “ ” in my case. You might need to enable viewing hidden files first. To view hidden files, just open Finder and press command+shift+. and those files and folders should appear. You can verify this by going here ~/ .

Xamarin Temporary Files

Checking for Visual Studio Updates

The Visual Studio Download Cache

I like to start with this one first. Make sure you check for the latest updates on Visual Studio and Install them before this step.

Then, go to ~/Library/Caches/VisualStudio/ -> And then in each of the Visual Studio versions, you can delete all the contents of the TempDownload folder. Also delete the ~/Library/Caches/VisualStudioInstaller/ folder

Temporary Nuget packages

There can be two nuget caches you can get rid of:

Go to ~/.nuget/packages/ -> Select All -> Move to Trash

-> Select All -> Move to Trash Go to ~/.local/share/ -> Select all folders -> Move to Trash

The bin & obj folders of your projects

Quit any iOS simulators & Android emulators if they are open. Now using your Terminal , go to each of your Xamarin solution folders and just type in the command git clean -fxd and hit enter to delete all the temporary files- including everything that is in the nuget, bin and obj folders of all the projects

Archives you don’t need

iOS Archives: Go to ~/Library/Developer/Xcode/Archives -> Select All -> Move to Trash

-> Select All -> Move to Trash Android Archives: Go to ~/Library/Developer/Xamarin/Archives -> Select All -> Move to Trash

iOS Temporary Cache

Simulator Data

Go to ~/Library/Developer/CoreSimulator/Devices -> Select All -> Move to Trash

Simulator Cache

Go to ~/Library/Developer/CoreSimulator/Caches/dyld -> Select All -> Move to Trash

Device support for older OS versions

iOS Archives: Go to ~/Library/Developer/Xcode/iOS Device Support -> Select All except current OS version-> Move to Trash

Note: This can save ~3.5 GB per OS version. You could delete the current OS version as well if you are getting support for the next version anyway

Cached iOS Designer files

Go to ~/Library/Caches/Xamarin/iOSDesigner and delete all the folders except the device_set.plist file

Android Temporary Data

Emulator Cache and Unused Emulators

Go to ~/.android/cache and make sure it’s empty. -> Then go to ~/.android/avd/ and make there’s only AVD folders and INI files for the emulators you still want.

Android Studio’s “.m2” folder

I had installed Android Studio for it’s awesome tools for App Icons, but even though I had deleted Android Studio, there seemed to still be a sizable chunk of files that it left on my Mac. Just go to ~/.m2 and delete everything you see if you don’t have Android Studio anymore

The Android Device Manager in Visual Studio for Mac

Reset Emulator Data

You can also go one step further and reset all the emulators on your computer to Factory settings using Visual Studio.

Open Visual Studio-> Device Manager -> Settings-> Factory Reset

Other Resources

Disk Utility on Mac showing Purgeable memory size

“Purgeable Memory”

If your Disk Utility shows that your hard drive has a lot of Purgeable memory available, that is occupying unnecessary space, you can empty it using these steps that worked for me.