"Not enough free space" when trying to install XCode even though there's ~7x more free space than required

The title says it all...

I am trying to install XCode, constantly getting that message, no matter what I try. Currently I have 41+ GB free space, XCode requires 6.1 according to App Store.


Please suggest how to solve this issue.


Thanks a lot in advance!

This solution did not work for me:
sign out from AppStore -> Restart Mac -> Sign in to AppStore -> Download Xcode

What DID work was simply deleting files and making sure I have at least 40GBs of space.
Had the same issue when trying to update to Xcode 12.0.1. Had 30GB free, but still not enough.

Solution was:
  1. Deleting Xcode 11.x from my Applications. (then I had 41GB free)

  2. Rebooting my Mac so the App Store notices that Xcode is not installed anymore.

  3. Downloading new Xcode Version.

Had the same issue. (MacBook Air late 2013, 256 GB SSD, only 40 gb of free disk space).

Solution: Remove Xcode from Applications (just go to Apps and delete it as you'd normally do with an app), and then download and install it from https://developer.apple.com/download/more/ .

Easy, quite quick and no problems.

P.S. XCode download weights 10 GB, and XCode itself weights 30 GB. So if you've already have XCode installed, then after removing it you'll have a lot of free disk space - which luckily should be no less than ~40GB that you'll need.
This is a real shame. Every xcode update is a maximum pain. I always postpone that process till the end. Apple! Do something with it!
I have this problem whenever there is a new version of Xcode. Such a horrible experience, Apple!
I literally can't download XCode because even deleting every single App on my Mac wouldn't give me enough space. Even deleting the Library folder wouldn't do it. I need to update XCode to do my job, and I tried deleting it so I could download the new version. Now I don't have 11.6, and can't download the new version either. I'm left without XCode at all. System files take up too much space. I have a 128 GB OS drive, where XCode wants to install, and I can't get enough free space.
If they let us install the newest XCode on another drive, maybe I wouldn't have this problem.

....Or maybe if it didn't require a ridiculous amount of space to install compared to how much space it actually uses, I wouldn't have this problem either. XCode is the most painful program I've ever had to use.
It took me a week, barking up the wrong three a lot, but I did it, an here is how:

My premesis:
  • A MacBook Pro 2017 with less than 10G space left

  • An Ubuntu 20.20 with plenty of space

  • An external 1TB SSD formatted with HFS+ and named "SSD"

Start with your Mac.
At first download Xcode from:
Code Block
https://developer.apple.com/download/more/?q=xcode

directly to your external disk, changing the download location in the Safari preferences. I have chosen v12.0.1.
Go to terminal an change directory to the mount point of your external drive.
On your Mac now unpack the .xip file using:

Code Block
xar -xf Xcode_12.0.1 /Volumes/SSD/


This is going to give you a folder named "Xcode_12.0.1" with two files inside: Metadata and Content.

Now switch to Ubuntu.
Download the files from this repository:
Code Block
https://github.com/NiklasRosenstein/pbzx/blob/master/pbzx.c

To compile it, I needed to download and install some old libraries from Ubuntu 14.10 on my Ubuntu 20.20.
I can provide more Information about this if needed, but mainly it is about the following libraries and packages:

Code Block
libxar-1.6.1-alt3.x86_64
libxar-dev_0.7r1785-5ubuntu2_amd64
xar-1.6.1
libpng12-0_1.2.50-2+deb8u3_amd64
libwxgtk2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64
libwxbase2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64

I also had to look for the xar.h I found somewhere I don't remember.

To make it easier I forked and uploaded the resources and a compiled version to:
Code Block
https://github.com/FolkertsHeiko/pbzx

Sure you have to trust me, but you can. I promise ;-).
If you want to do it yourself, here is the gcc command line, but do not expect it to work out of the box:

Code Block
gcc pbzx.c /usr/lib/libxar.so -lxar -llzma -o pbzx


To mount the external volume you sure going to need the hfsprogs package:
Code Block
sudo apt-get install hfsprogs


Next, mount or remount the HFS+ drive:

Code Block
sudo mount -t hfsplus -o force,rw /dev/sdXY /media/mntpoint


or

Code Block
sudo mount -t hfsplus -o remount,force,rw /mount/point


Now decompress the Content file with the self-compiled pbzx binary, both mentioned above, and unpack it with cpio, which already was installed on my Ubuntu System:

Code Block
pbzx -n /media/heiko/SSD/Xcode_12.0.1/Content | cpio -i


This will give you another folder in your current working directory, named Xcode.app

Go back to your Mac and link the Xcode-Application:

Code Block
cd /Applications
sudo ln -s /Volumes/SSD/Xcode.app/ .


Now run it with Finder, which is going to take a while for the first start.
After that, Xcode should run from your external drive.

I hope this is helpful.

Happy coding,
Heiko.

Edit: Typos

tl;dr: You are only going to need round about 45G on the external SSD. My solution is to unpack the .xip file containing Xcode manually there and run it.
same thing here. I've had 41Gb free space and anyway been forced to delete XCode & reboot before XCode upgrade agreed to download. it is maddening
Guys, just throw this shit and buy Samsung laptop with hackintosh.
BartoszMaciejewicz has the right answer...

Hey, I found a working solution

After update macOS to the 10.15.6 I noticed that Xcode throws info that is not enough space on disk to update app, so I tried to run old Xcode and I noticed a popup about missing requirements, after click "install" the problem about updating Xcode in AppStore gone.

There was no needed steps to uninstall Xcode so I'm happy of that :)

I hope that this will help you too

Posted 1 month ago by BartoszMaciejewicz 
My XCode 12.0.1 was not updated to 12.1 (there was a notification that there was not enough free space) - 35GB was available on the disk.

In the end, I solved this problem by getting 45GB of free space and Xcode began to update.

I think this is not a bug. If the App Store indicates that the size is, for example, 11.3GB, then this is only the package size. In reality, after installing Xcode, it takes a lot more. For example, I have 16.2GB of the application itself + 35.3GB of additional resources in the Developer folder (simulators, archives, etc.). 51.5GB! And updating and downloading an application is only possible if there is space to install the application, not to download it.
Apple stop wasting our time, fix this it is just outright a disappointment.
Stop messing our development time and streamline this process.

Code Block
cd ~/Library/Developer
rm -rf Xcode

This seems to be the quickest way around this for now.
thanks @ajax8732  & @bob1993

This is such a shame Apple.
Around 50 gb of disk space works
"Not enough free space" when trying to install XCode even though there's ~7x more free space than required
 
 
Q