5

I am trying to update XCode from 11.2.1 to 12.4. I installed XCode from the app-store, so I am trying to update it from there itself.

I have 27 GB of free space, but every time I try to update, it says I do not have sufficient space.

enter image description here

I don't think there is anything else I can delete. I removed the deviceSupport, derivedData, archives, unavailable simulators etc. I am on MacOS Catalina 10.15.7. This MacBook only has 128GB hard drive.

Without updating XCode I can't run My iOS 14 test devices with this.I dont need the latest version, just the version capable of running iOS 14 devices.

How much space does this XCode consume? How can I update this?

PeakGen
  • 21,894
  • 86
  • 261
  • 463
  • It will cost ~33 GB. How about remove your current code version and download the new one again? You can also download dmg file here: https://stackoverflow.com/questions/10335747/how-to-download-xcode-dmg-or-xip-file – son Feb 16 '21 at 11:42
  • 1
    @son Okay. How did you get the number 33GB? I can uninstall the MS office package for now. It will clear 6 GB – PeakGen Feb 16 '21 at 11:55
  • okay, for me it worked for 43.21 GB free space. – John Stuart Aug 29 '21 at 18:10
  • @JohnStuart: This issue is already fixed for me because i purchased a new macbook, but i am glad you provided an exact figure. – PeakGen Aug 30 '21 at 03:56
  • 3
    Does this answer your question? [Xcode on Mac App Store can't install , show disk space not enough](https://stackoverflow.com/questions/53432700/xcode-on-mac-app-store-cant-install-show-disk-space-not-enough) – DisgruntledGoat Feb 15 '22 at 12:57

8 Answers8

3

This is pretty much everything you can do:

  1. Check if you cleared all possible garbage that Xcode stores (blog post).

  2. Free some disk space by deleting other programs/junk.

  3. Completely reinstall Xcode.

  4. Completely reinstall macOS to wipe your whole disk.

  5. Time to buy a new Mac I guess?

Tomas Jablonskis
  • 4,246
  • 4
  • 22
  • 40
  • 2
    Holly Crap! Just to upgrade XCode all this trouble? Apple is all about selling it's damn hardware by making problems.. – PeakGen Feb 16 '21 at 11:54
  • Nah, IMO you just made a mistake of buying into 128GB :D Once my Xcode and all its garbage used more than 80GB of memory, which is insane if you think about it. And when the disk space gets lower, Xcode starts to run slower too... – Tomas Jablonskis Feb 16 '21 at 11:58
  • Do you know how much space is needed for installing the XCode version I mentioned? I can delete MS Office package for now. – PeakGen Feb 16 '21 at 12:01
  • No, unfortunately, I do not. – Tomas Jablonskis Feb 16 '21 at 12:02
  • I have the same problem and I bought my M1 Air with 512GB specifically hoping to avoid this. I couldn't afford bigger than that. – hippietrail Jun 23 '22 at 08:43
1

I have faced this issue many times, so in search of this I found that newer version of xcode requires around 35-40 GB of free space to get updated. In 27 GB it would never get updated. so after removing all junk you can do following steps.

  1. remove derived data , unnecessary Simulators.
  2. there is folder of xcode cache in xcode you can remove that (this takes more space, in mine it was 10GB)
  3. if you are left with 1 or 2 GB restart your mac this would work.
  4. if you have come to this step this means nothing worked so best solution is after doing above 3 steps uninstall the xcode and install it again.

P.S : I have tried all this steps twice to update my xcode as I also have 128 GB storage only,

Chahat
  • 11
  • 1
1

Xcode 12 need about 25-30GB to unpack. I had to free about 42GB for the app to download from the App Store. I strongly recommend OmniDiskSweeper(free). It removed about 32 GB of unnecessary data on my 128GB MBP.

David K
  • 73
  • 4
1

All the above answers are correct and gave me a good move. However it was impossible for me to clean 40-50 or more gigs from my laptop.

I purchased a new MacBook M1 Pro 256GB laptop. However now I am following the below to keep more space available.

  1. Install only most wanted software. I have multiple laptops, two macs and one windows. My windows PC has all the software I need. my old MacBook is now for Java based developments, emails, docker and so on. My M1 Macbook pro is only for XCode and Flutter, mobile based stuff.

  2. I installed a XCode cleaner, downloaded from app store. I think I had to buy that.

  3. My macbook do not have lot of other files now. I store them in cloud. When needed I download them and edit. Otherwise they will be handled in Windows PC where I have 1TB and more.

ADVICE: IF YOU DO DEVELOPMENT STUFF IN MAC, BETTER BUY A PRO WITH AT LEAST 256GB IN IT!

PeakGen
  • 21,894
  • 86
  • 261
  • 463
0

You can manually download your desired Xcode_12.4.xip file from https://developer.apple.com/download/more/

Here I faced so many complexity with space issue. However by following steps Finally I installed Xcode_12.4

From terminal this command will expand the Xcode. but it will expand in your home dir

xip --expand Downloads/Xcode_12.4.xip

For Application directory installation , you have to go Application directory first.

cd ~/Applications #otherwise, will unpack into home dir

then run this command in terminal

xip -x ~/Downloads/Xcode_12.4.xip
Mimu Saha Tishan
  • 2,402
  • 1
  • 21
  • 40
0

If the xip command fails is because there is not enough space in the startup Disk because of the time machine local snapshots. Do this:

  1. Disable time machine while this process finish
  2. You have to delete local snapshots of time machine

tmutil listlocalsnapshots /

then delete them:

sudo tmutil deletelocalsnapshots

add one space and the date of the snapshot like: 2021-06-24-201254

if all is ok you will get a message like this:

Deleted local snapshot '2021-06-24-201254'

  1. Now you can execute the xib and will work (I hope so...)
galo hernandez
  • 163
  • 1
  • 3
0

You need at LEAST 1TB of boot drive to do Xcode projects! Especially, like me... if you also do graphics, video and music and other stuff, I do with FCPX and Garage Band, Logic Pro with lots of filters and all the loops!

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/30196265) – TheRealHypo Oct 28 '21 at 03:03
  • Turns out for me, I needed to free up 45GB of boot drive to install Xcode. I actually deleted XCODE application from my Mac, last time that worked, but this time it didn't, so I deleted fiies until there was a bit over 45GB of free boot drive and that worked! I will never get a Mac with less than 1TB boot drive and likely plan 2TB and more boot drive! JOHNAVATAR.com – JOHNAVATAR.com Oct 29 '21 at 18:37
0

You can automate it by scheduling a cron to delete all local snapshots at a mount point.

I have a cron job that executes every 30 minutes to delete all snapshots from my root directory

'*/30 * * * * tmutil deletelocalsnapshots /'

30 minutes is probably a little excessive but ensures my local space is available when needed.