"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!

Xcode 12 takes 28 GB installed + a place to hold the compressed app image of about 14Gb, that is 42 Gb. The compressed image can be deleted AFTER the install completes.

The error message is legitimate.
I never post to forums, but this one has my blood boiling!
Here's my fix, then I'll explain how I got there to save time for those that aren't bothered with the story.

I deleted 10's of Gb from the developer folders:
/(myuser)/library/developer/xcode/ios devicesupport/(device versions back to iOS7)
/(myuser)/library/developer/coresimulator/devices/(device GUID)

Viola!

So, I lost a day to this. 36Gb was not enough space, so I deleted some applications, but no joy.
Storage Management recommended that I delete large files, which it said were all in OneDrive. That's when I learned that you can't easily remove OneDrive (thanks Microsoft for your help here).

After downloading 30Gb of files in OneDrive, so that I could delete them locally, the free memory didn't increase. I should have known because cloud storage doesn't take up local space. This is a failing between Storage Manager and OneDrive, where one thinks the other is using HD space.

After losing a day, I paid for CleanMyMac, which pointed me to the Xcode folders above.
So let's get this straight: I can't install Xcode because Xcode has filled my computer with libraries for iOS 7-10 compatibility.

Apple, please do something about this. You charge enough for your development program that it shouldn't be this painful.
im actually thinking to leave apple after all the years i have invested in xcode-objc, swift.
it's just, i feel like, they are not worth all the pain anymore...
These steps finally works for me by using Terminal:

Remove Xcode (Removing /Application folder requires using sudo for root access):
Code Block
sudo -s
rm -rf ~/Library/Developer/Xcode
rm -fr /Application/Xcode.app


Download Xcode from Apple:
Code Block
https://developer.apple.com/download/more/?q=xcode
  • Download to a Removable Drive

  • or Move the file from Download Folder to the Removable Drive

  • I use a 32GB USB Flash Drive formatted with Mac OS Extended using Disk Utility

Extract and Install:
Code Block
sudo -s
cd /Application
xip --expand /Volumes/<USB_DRIVE>/Xcode_<version>.xip


i just stop being Apple app developer.
i don't need this ******* problem anymore.
40GB not enough?
what wrong with Apple.
is they meet their end?
i will change my Macbook to laptop next week.
Same here, I seem to have that problem * every single time * Xcode gets updated - right now I have 34 GB available on my HD, and Appstore says that the Xcode 12.3 update needs 11.6 GB - yet when I tried to install, I get "Not enough disk space". I reckon there is some decompression of downloaded files going on, but 34+ GB available space not enough disk space is a ludicrous management of resources on Apple's part. I guess my only option is to uninstall Xcode first and then re-install the latest version from scratch.

Apple, you guys are the experts - this is the best you can come up with..??? What a shame.
Here's what helps:
  • In the Apple Manu, go to About this Mac > Storage > Manage > Developer (nice little Easter egg hunt, well done Apple!)

  • Look for older iOS variation you don't need, those can easily take up a good number of GBs

  • There are also big size options "Xcode Caches" and "Project Build Data and Indexes", though I'm not sure how much trouble might be caused by deleting those

  • Lastly, uninstall Xcode before installing a newer version

  • There also is a free ("suggested tip-ware") app named DevCleaner which essentially appears to look for the same files as described above

Some more proactivity on Apple's part on this would certainly be useful though. To just leave a user with a "Not enough disk space" error message upon trying to update Xcode when there are dozens of available GBs on the drive is not exactly helpful.
I can verify that, having 50GB free storage on machine will resolve this issue. I was having 18GB previously, though the xcode12.3 xip size only 11.63 yet I can't extract.

Some files you may consider to remove to get get storages
  1. com.apple.dt.XCode (~/Library/Caches) - about 2gb

  2. iOS DeviceSupport (/Library/Developer/Xcode/iOS DeviceSupport) - I have like 32 GB here

  3. DerivedData (/Library/Developer/Xcode/DerivedData)

basically, Apple wants me to free up 50GB of storage from my 128GB MacBook pro.
well done Apple!!!!

This is a shameful apple.. at least you should reply to this.


I’ve gotten that issue a lot as well. For me, it worked after I restarted my laptop.

Hope this helps!
Managed to get it to install after deleting the various folders in Cache and elsewhere mentioned in this thread.

This is typical of Apple really. They make nice hardware, but when it comes to their software it's pretty flakey, often not very intuitive, and while perhaps some people push the line that Apple software "just works" that's certainly not my experience. The frequent changes to App Store Connect documentation, web interface, certificate and signing rules, etc etc., demonstrate a blatant lack of respect for the Apple developer community. Having to clear 50GB just to update a package that it already installed is, simply, poor design and poor implementation, but more fundamentally it just shows the Apple philosophy: "You want to develop for our platform? You need to work or beg for the privilege"
This has been, without a doubt, the most frustrating experience I've had as a developer in my 10+ years of software development. Why, in God's holy name, do I need 40GB+ just to update a framework that I ALREADY have installed in my system? Apple really expects you to have a machine SOLELY for the privalge of developing apps on their platform. This is beyond explanation, and by all accounts, intentional. I, for one, will think twice about developing for Apple in the future after this horrid experience.
It worked for me after restarting my laptop as w/ @CodeSwiftUI
Shame on Apple! I have 41 GB free space but I can not update latest Xcode which has just 12 GB. How much place it needs to unzip? My 4 year old MAC with 120GB disk is not usable I can trash it because I have there just MAC OS + Xcode and it says that 40 GB is not enough for Xcode update. Terrible! Also it always downloads Xcode from the start! Dear Apple, why I have to download several times 12GB when you show alert about not enough space to install (but it is already downloaded because it has only 12Gb and free space is 40 GB, why you delete it???). I have to download again and again after unsuccessful Update button click.
"Not enough free space" when trying to install XCode even though there's ~7x more free space than required
 
 
Q