App Store: Not enough disk space to install Xcode

Similar to Xcode free space requirement, but different details.

We could not complete your update

There is not enough disk space available to install the product.

The download size lists:

Version 11.0 • 7.6 GB

and my Mac has 31.2 GB available according to About This Mac : Storage

My question is this: How can I discover what the exact storage requirements are for this update without performing the update? I'm looking for a definitive answer, not methods for estimation. Thanks!

EDIT: I'm not looking for sector-specific values. I'm just trying to understand how much available storage is actually required for a successful update—clearly it's not 7.6 GB.

EDIT 2: Mysteriously, Xcode now updates with no change in available storage space. In fact, it appears I have a few hundred MB less available storage than before.


Solution 1:

I don't think there is a definitive answer, because it's likely to depend on the specific Mac & how the data aligns to sector sizes when written. You'd see the same thing if you wrote a 1GB movie file & 1GB of small text files to a drive. The byte count may be the same, but the space used on disk would not.

If you look at the three basic ways to see how much space is left on your drive [Storage, Disk Utility & Get Info], one thing you'll notice is they don't actually agree on their definition of "free" space.

If your drive is so full that you are struggling to squeeze something on - which in itself is not a good thing, you really need to keep 10 - 20% free space, ironically more for a smaller drive - then the figure you need to be looking at is the one in Disk Utility, under the blue bar [green outline].

That is the amount of actual free space you have, including purgeable.
Purgeable data will not just get out of the way if you need the space all in one go. You need to either manually shrink local Time Machine backups, or incrementally fill the drive with junk data then erase it. If you have "Store in iCloud" set up, you need to give it time to work, whilst you do this.

enter image description here

Solution 2:

There's really no easy way to produce a definite answer for you. The definite answer varies from system to system.

You could get the definitive answer by freeing a small amount of disk space. Taking a full backup of your system. Try installing. When it fails, restore from backup. Repeat until you have the definitive answer.

It would be an unrealistic amount of work to get to a number that you would then have no interest in having, as you have already installed the software.

EDIT: You have changed your question so that you no longer require a "definitive" answer, but rather want an "approximate answer". To that I can I add that my installations of Xcode are approx. 15-20 GB in size depending on what exactly is installed on each computer. Note that for updating you'll need room for both the currently installed version plus update files. You might find that it is easier on your disk space requirements to simply delete Xcode, and then reinstall it. You might get be with even less disk space if you download Xcode manually from the Apple web site instead of from the App Store.