Can't update to Xcode 13 (Error: Not enough disk space)

I wanted to update my Xcode to Xcode 13, because it just came out yesterday. But now I'm facing the following issue while trying to update it from the App Store: The App Store shows me, that I don't have enough disk space, although I have 39 GB free storage on my Mac.

I also just updated to the newest Software Version for my Mac (macOS Big Sur 11.6) and then restarted my Mac, but it´s still not working. I looked through a lot of forums, but I can´t figure out why it isn't working. It seems to be a common issue for a lot of people when a new version for Xcode releases.

Does anybody faces/faced the same issue and knows a solution for this problem?

Answered by OscarJunius2411 in 688986022

I solved my problem by freeing up more space on my Mac by uninstalling large applications and reinstalling them after the Xcode update was successful. In the end, before updating Xcode through the App Store I had about 4x - 5x more disk space than Xcode actually needed.

For anyone else I would still suggest to follow @jva´s answer, because I think that my solution was very device specific. But if nothing works I would suggest to try out freeing more space on your device.

I faced the same situation a year ago. I had enough free storage shown in Finder, but I couldn't use it. For me, it was because because it was "purgeable".

You can check this in Apple Disk Utility --> Go to the drive --> Check the stats "Available" and "Purgeable". If te Purgeable number is large (Gigabytes), you have to check this:

https://apple.stackexchange.com/questions/254676/how-do-i-clear-the-purgeable-area-on-my-disk

It's not the first (accepted) solution that solved it for me, but the second one: "You can create a huge file that will force macOS to clean purgeable files to free you space. Do do so...". The faster way is to create a huge file using Disk utility, then delete that file. To create that file:

  • Launch Disk Utility and choose “New Image”
  • Name the file as appropriate, then pull down the “Size” sub menu and select a file size appropriate for your needs
  • Ignore all other settings and choose “Create”

After the huge file (make it almost as large as the purgeable size) was created, delete it, and all available space was truly available. Let me know if this solved your problem too!

If this is not the case for you, it could be because the App Store download actually requires twice the App download size as disk space. For Xcode this is pretty huge, but your 39 GB should be more than enough. Nevertheless I always prefer installing Xcode manually (normally listed here), by simply downloading the file and extracting it. It gives me more freedom over Xcode versions. The only problem with this, is that Apple still hasn't listed the full Xcode 13 download on that page, even now a full day after public release. So I'm still waiting...

Accepted Answer

I solved my problem by freeing up more space on my Mac by uninstalling large applications and reinstalling them after the Xcode update was successful. In the end, before updating Xcode through the App Store I had about 4x - 5x more disk space than Xcode actually needed.

For anyone else I would still suggest to follow @jva´s answer, because I think that my solution was very device specific. But if nothing works I would suggest to try out freeing more space on your device.

If you are not developing iOS applications, might you don't need the full install of xCode.

Removing previous version of Command Line Tools and installing new ones in two lines in Terminal:

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install  

Will install CLT into the "/Library/Developer/Command Line Tools" folder and it is ~2GB total for xCode 13.2

I had to delete and reinstall after recent Monterey upgrade.

I had this problem a lot, too. Here are a few solutions:

general notes

  • The App Store says Xcode is 12.7 GB (13.3.1). I don't know why it says that, because:
    • The Xcode app is 32.5 GB, though it takes "only" 17.4 GB on disk.
    • I don't know what "on disk" means vs not, but it's right there if you "Get Info" on the Xcode app.
  • In practice, the App Store will say we don't have enough space unless we have ~46 GB free.
    • If you have a more precise number and/or know how to calculate it, let us know here!
    • (Add the Xcode app size of 32.5 + the App Store's 12.7 = 45.2?)
  • When upgrading Xcode, you can delete the old app version to free up space, then install the latest version.
    • Or safer: Copy the old Xcode app to another drive, just in case the new install fails.
  • Besides using the App Store, you can install/update Xcode manually. The problem with that is the App Store will then get out of sync, and thus think you don't have the latest version of Xcode, forever. This gets frustrating if you like having automatic App Store updates.

via the App Store

manually via the Apple Developer download page

  • (https://developer.apple.com/download/applications/)
  • You could, for example:
    • Download the Xcode .xip (13.3.1 is 10 GB) and then extract it
    • If you don't have enough space to extract, then move the .xip to another drive and extract it there, then copy it back, overwriting the old Xcode app
  • Note: extracting the .xip is apparently much faster via the command line
    • (https://twitter.com/_saagarjha/status/1481353292164698112)
    • e.g., xip --expand <input-file>

"manually" with the third-party app, "Xcodes"

  • (https://github.com/RobotsAndPencils/XcodesApp#installation)
  • I tried this on my 2019 MacBook Air with its tiny 121 GB drive. (My only Mac right now.)
  • This actually worked really well. With the app's "Experiments" turned on, Xcode updated without me having to move or delete anything. (I had 37 GB free.)

remember

  • A manual solution may require less space, and could install faster. But then the App Store will always think you need to update Xcode. (Until you do update/install Xcode via the App Store.)
  • Having another drive is your friend and key to this! It doesn't have to be a big fancy external drive; I used a 120 GB flash drive/stick. Kinda slow, but it got the job done.
Can't update to Xcode 13 (Error: Not enough disk space)
 
 
Q