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 or , 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 , 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 “” in my case.
  • You might need to enable viewing hidden files first. To view hidden files, just open and press 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 -> And then in each of the Visual Studio versions, you can delete all the contents of the folder. Also delete the folder

Temporary Nuget packages

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

  • Go to -> Select All -> Move to Trash
  • Go to -> 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 , go to each of your Xamarin solution folders and just type in the command and hit 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 -> Select All -> Move to Trash
  • Android Archives: Go to -> Select All -> Move to Trash

iOS Temporary Cache

Simulator Data

Go to -> Select All -> Move to Trash

Simulator Cache

Go to -> Select All -> Move to Trash

Device support for older OS versions

  • iOS Archives: Go to -> 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 and delete all the folders except the file

Android Temporary Data

Emulator Cache and Unused Emulators

Go to and make sure it’s empty. -> Then go to 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 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

Other Resources

Disk Utility on Mac showing Purgeable memory size

Purgeable Memory

If your 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.

Et puis voilà! Once you’re done deleting everything, don’t forget to remove it from the Trash. Go to -> Delete All. You now have a lot more space available and should have no trouble installing what you need!

Git Objects folder

If you are using Git for source control, there’s a chance that after deleting the bin & obj folders and nuget packages, your app repository is still ~2GB in size. But when you add up the size of the remaining files, it’s supposed to be less than 50MB. If you look at the hidden files, you’ll notice the space occupied by the directory of the hidden .git folder. As you can see here, you can run this command to shrink it:

References

Thank you to James Montemagno for “Cleaning Up Space on Your Xamarin Development Machine” and Charlin Agramonte for “Running out of space using Xamarin”. Their articles were a great starting point, and are the real MVP’s.

Developers building things, on here to share knowledge. Featured blog for PlanetXamarin.com github.com/saamerm linkedin.com/in/saamer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store