XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.68k stars 126 forks source link

Reclaim the APFS container space before download and unarchive steps #155

Open nalexn opened 2 years ago

nalexn commented 2 years ago

I'm constantly getting hit by this error:

Xcode.xip can’t be expanded because the current volume doesn’t have enough free space.

alt text

I DO have x2 - x5 times the size of Xcode archive or the binary, but the problem is really with the way APFS works.

Following this tip I'm creating a large (~20 GB) file before downloading or unarchiving, and then deleting it after a few seconds and proceeding with the installation.

I thought Xcodes might automate this step.

There is a complete article explaining the underlying APNS problem, but in case it's behind the paywall for you, here is the command that creates a 20GB file:

dd if=/dev/urandom of=temp_20GB_file bs=1024 count=$[1024 * 1024 * 20]