Xcode: not enough disk space even with 75GB free

Hello everybody!


I've just updated to Mojave and am experiencing some issues getting my development back on track. I think several issues I have are to do with not having the latest xcode (e.g. git integration in visual studio code)


No problem, I go to the app store and try to download xcode. But I get this:



But I seem to have plenty of space:



One possibility that comes to mind is this purgeable space:



But 1- I can't do anything about it and 2- It shouldn't be a problem in theory


Any ideas?

Apologies, I'm new to this forum. I thought I could add screen grabs to my post, but none of the images turned up. I'm also at a loss as to how to edit my post.


The first image showed the app store telling me that I couldn't install xcode because there wasn't enough disk space.


The second image showed the "storage" section in the "about this mac" window with 77GB free space


The third image showed the "Get info" on my hard disk showing 76,12 GB available (63,43 purgeable)


The more stuff I delete, the more "purgeable" disk space I have, and I wonder if that's where the issue is.

About screenshots/inline images and editing see: For Best Results - Read the Label - good on you for using your words in the mean time 😉


About space, do the math, but first confirm the trash has been emptied.


That math includes all of these, at the same time:

- Swap space macOS needs to breath

- Space to download whatever

- Space to unpack the download

- Space to hold the unpacked download when mounted

- Space to install the unpacked download


I'd casually estimate that, with current tools, to be around 30 GB.


Additionally, space to download and install add-on components.


Off hand, unless something has changed recently, I'd normally say that at a minimum, 77 GB should be enough, not that I'd advocate keeping it that low, so as an exercise only, you should have enough at that level. Real world, all bets are off, as not being able to look over your shoulder cold shoulders further analysis.


With persisting app store admontions at 77 GB free, something in your case is atypical, I think. At the risk of blaming the victim, it might be more about housekeeping in general than it is about the tools and the store, unless of course the store has recently raised requirements vs. what it took to make it squeal in the past.


Want to live large, take the hint and get a larger drive/SSD...now. Estimate what you think you'll need in total drive capacity, then double that figure, then double it again and go shopping. Drives are not that expensive and when it comes to being a serious dev, it's just another part of doing business.


All that said, there are reports of the low space message being a bug (with the store?), so if you're happy that you have enough, check threads here for steps that might help get around it.


Good luck.

Awoogamuffin wrote:



The more stuff I delete, the more "purgeable" disk space I have, and I wonder if that's where the issue is.

Exactly. You really only have 13 GB free. You can try erasing any Time Machine local snapshots. But even after installation, Xcode is a disk hog. You will have to do some serious purging of files.

Did you find a solution? I just cleared out a lot of space and made up to 104.3 GB available (according to About This Mac) and the App Store still says there isn't enough storage available for Xcode.

Same issue for me. Lot of memory available as per About This Mac page but still not able to install xcode 10.2. Any suggestion how to resolve this please

Here is what I did when experiencing the same problem:

Go to https://developer.apple.com/download/more


There you will find Xcode 10.2.xip.

Download that to your Mac and unxip it by double clicking the .xip file in your Downloads folder.

Move the resulting XCode.app file to the Applications folder.

I also downloaded the "Additional Tools for Xcode 10.2

When I double clicked the Xcode app in the applications folder it tells you it needs more required files. Click OK or install or whatever to accept.

Once that is completed, Xcode worked and compiled my project just fine!

I run Xcode beta on a 125GB MacBook and the release versions on a 1TB MacMini. Not surprisingly, the MacBook often runs out of space for downloading and/or installing new betas. I use 2 methods to overcome this: 1) delete unwanted Simulator files from LIbrary; 2) move the downloaded xip file to an external temporary drive (eg USB stick), unzip there, then move the Xcode app to the Applications folder on the MacBook. Oh, and of course always make sure I've emptied the bin and cleaned up other garbage.


Simulator files take up several GB of space and I never use most of the devices/versions.

Note that the Finder always says "available" storage space, not "free". There is actually only one obscure place where the Finder actually uses the word "free" and that is wrong, because it is actually showing "available" space.


If you want to know how much space you truly have "free", you must run "df -h" in the Terminal.


The Finder's concept of "available" is free space + "purgeable space". However, the Finder (or rather, the OS in general, from APFS all the way up to the Finder) has a very difficult time calulating accurate values for "purgeable space". To make matters worse, if you truly have low "free" space, then those calculations are even more wildly inaccurate.


In theory, when you request more space, it is supposed to do whatever is necessary to free it up. In practice, this doesn't always happen.


Remember, if you are here, you are developers, not users. Your Mac is not a beloved, intimate device. It is a tool. If it misbehaves, wipe it and reinstall what you need. While the reinstall is running, you can use your other machine that you normally reserve for beta testing.

Some of us don't have the luxury of having more than one Mac. lol

I ran into this exact problem. I had over 120GB "free" too, but in Disk Utility, only ~5GB was actually free, the rest was "purgable". I also don't have time machine enabled, so there were no local backups to delete.


What worked for was toforce the os to purge the space.


To force macOS to purge the space, I creating a huge (60GB+) garbage file, then deleting it.


To create the file I used the command:

dd if=/dev/zero of=~/hugefile bs=100m

letting dd run for about 30 seconds, then killing it with ctrl+c, and deleting the file. After this, disk utility reported I had 100GB free with only 20GB purgeable, and the App Store then happily installed the 10.2 update.

What if your Mac fails or gets stolen? While the Mac is a consumer device, Xcode is a professional tool that assumes developers have professional resources.

APFS makes local snapshots even if you don't have Time Machine enabled. You could have probably removed your local snapshots with an aggressive tmutil trim command. However, your dd solution is clever as it would force purging of other things beyond local snapshots.

I'd have to buy another one and restore from backup. But the return on app sales is so low these days I might not bother.

I wouldn't suggest doing that either. The OS will think there are two copies of itself and you'll experience random problems. Only restore from backup if the old machine really is gone for good. Otherwise, setup the machine from scratch. Use iCloud to initialize your user account. Manually install any apps.


Low app sales is a different question.

I have same problem. At first i thought it was bug.


At one time I realize that I have mac os update notification ignored. I thought maybe I have to update my os first. So I casually did an update. After that go to appstore and did update xcode and it worked. No more message "not enough space".

Xcode: not enough disk space even with 75GB free
 
 
Q