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.
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?
8
Answers
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.
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.
I installed a XCode cleaner, downloaded from app store. I think I had to buy that.
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!
This is pretty much everything you can do:
Check if you cleared all possible garbage that Xcode stores (blog post).
Free some disk space by deleting other programs/junk.
Completely reinstall Xcode.
Completely reinstall macOS to wipe your whole disk.
Time to buy a new Mac I guess?
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.
P.S : I have tried all this steps twice to update my xcode as I also have 128 GB storage only,
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
For Application directory installation , you have to go Application directory first.
then run this command in terminal
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.
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:
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’
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!
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.