Xcode disk space requirements

I've been trying to install Xcode 7 tonight with no real luck.


I'm running a Mac that generally has about 12 GB spare. I tried installing the Xcode 7.1 beta on a separate drive however it insists on installing all of the simulators on the primary hard drive, and it runs out of space.


So perhaps it's time to wipe Xcode and reinstall clean. This mac has a primary drive that started as Snow Leopard on a white macbook back in 2009. It's been backed up and updated regularly, and I wonder if this has left me with a lot of old cruft.


Acording to DaisyDisk I have:


/Applications/Xcode -> 3gb (Xcode 6)

/HD/Library/Developer -> 15.6gb

/HD/Library/Developer/CoreSimulator -> 13gb

/HD/Users/me/Library/Developer -> 69.9gb - why?

/HD/Users/me/Library/Developer/Xcode -> 53gb

/HD/Users/me/Library/Developer/Shared -> 8.7gb

/HD/Users/me/Library/Developer/CoreSimulator -> 8.1gb

/HD/Users/me/Library/Developer/Xcode/iOS DeviceSupport -> 46.7gb - devices all the way back to 5.0.1

/HD/Users/me/Library/Application Support/iPhone Simulator -> 1.8gb


Really, do we need 4, or 5 folders of simulators, amassing almost 70gb of disk space?


Can I be brutal and remove:


/HD/Users/me/Library/Developer

/HD/Library/Developer


and then reinstall Xcode from scratch? will this actually give some space back?


Any help would be appreciated.


Peter

Accepted Answer

12 GB spare is barely enough for the OS to create and utilize swap space. Remember that when installing Xcode, as an example, you need:

- space for the download/package

- space to unpack

- space to install


That could amount to from 8 ~ 12 GB as a rough estimate.


I'd at least double the free space, but still consider that cushion to be near minimum, and not for routine operation. I get nervous when I see less than 250 GB free on my 2 TB boot drive.


Rather than try to eke out room on your current HD, I'd invest in much larger HD, with room to grow over the next year or two, at least. Figure what you need and then double that number.


Good luck.

Thanks @KMT. Thats why I tried installing on a secondary drive. A 250GB drive is all I have without buying a new machine altogether which is simply not an option. I agree that running with <20gb is not ideal. That's why I was asking about whether removing all or some of those directories and reinstalling from scratch would save me space (improve my situation).


This is a macbook,so although I can set up an external boot drive for use at home, it's not practical on the road.

>Thats why I tried installing on a secondary drive.


As you discovered, Xcode needs to run from your boot drive.


If you can't move to a larger internal, I'd try harder to make use of an external boot drive work in all cases, rather than seek to pare down the application/related files, etc.


I don't see how your idea would matter when it came to another/scratch reinstall, given the likelihood of a repeat, sorry. I still think you've painted yourself into a corner 😟

Well, that's a shame then.


I had hoped that someone might have known if some of those folders of simulators were perhaps legacies from older versions of Xcode that could be removed, thus saving a lot of space.


A 250GB drive should be more than adequate for software development. Perhaps I'm too old.

>A 250GB drive should be more than adequate for software development

Maybe, if you plan ahead, to only shoestring the entire effort on a very limited basis.

Look at it this way - dev'ing isn't about just the immediate IDE. Docs, sample projects, assets such as audio/video/images/data bases/...all add up. Not to mention the ancillary applications/tools/editors for those assets. Then there is the obligatory backup. Then there is the growth over time.

The important spec is how much free space is available, not how large the hard drive is.

Too old?

Do you remember the IBM PC-XT that had a 10mb hard drive?

I remember my 5mb profile hard drive with my Apple II.


At the moment, Xcode and its simulators are using just over 90GB. Is this normal? If it isn't then a clean out of all those folders (i.e a brutal deletion) and a reinstall seem to me to be in order and should return me some space.


Is anyone in a position to do a:


du -s -m /HD/Users/<user>/Library/Developer /Library/Developer


and post the results? It would be interesting to get a ball park figure for what is normal.


Thanks

Not sure about 'normal', but:


7563 /Library/Developer

Thanks, as you'd have seen, mine is twice that. How large is ~/Library/Developer ? That's where most of my space is lost.

~/Library/Developer: 22.43 GB


/Library/Developer: 7.93 GB


Note I have both release Xcode 7 and 7.1b installed.

Thanks @KMT. That seals it. I've got too much old stuff floating around. Backups almost done.


I appreciate your time.

/HD/Users/me/Library/Developer/CoreSimulator -> 8.1gb

You can reduce the size of this directory by going to the Devices window in Xcode and deleting any Simulator devices that you don't use (each directory there corresponds to a Simulator device displayed in the devices window). Make sure you use Xcode (or xcrun simctl) to do the deletion; don't just delete them from the filesystem. If you change your mind later, you can always create new Simulator devices

/HD/Users/me/Library/Developer/Xcode/iOS DeviceSupport -> 46.7gb - devices all the way back to 5.0.1

The directories in "iOS DeviceSupport" are required for symbolicating crash logs from devices running the corresponding version. Use your judgement as to whether you can delete those directories. Worst case, you can back them up to DVD somewhere and delete them to save space. They are also used when debugging on devices, but Xcode will automatically regenerate them when you attach a device that doesn't already have a corresponding iOS DeviceSupport directory.

/HD/Users/me/Library/Application Support/iPhone Simulator -> 1.8gb

You can safely delete this directory (i.e. it hasn't been used since Xcode 5.x)

Thanks for that information; it was very helpful, and in line with another site I found:


http://blog.neverthesamecolor.net/how-to-recover-disk-space-from-xcode/


I've completely cleaned out things, unfortunately before I saw your reply so I was perhaps more brutal in my methods. Time Machine has everything on file in case, but I can report that having now updated to Xcode GM 7.0 and also having 7.1 installed, I now have 55GB free, with all simulators re-installed and all docsets installed.


I means I've now lost the Xcode 6 installation (and iOS7 simulators) but that's OK.


Thanks all.

I too have a macbook air and this week successfully installed OSX 10.11 GM candidiate on a 32 gb flash drive --- runs well!

soooo

you might want to consider a 128gb flash/thumb drive (usb 3.0) and install your os X and Xcode on that- so your laptop can free up space...

I find it very portable, so might you 🙂

I had the same situation a week ago. It is quite unreasonable to have 70GB wasted.


While I agree in general that living near the edge of a full hd is not a good idea, I'm disappointed in the common community response which is just to get a bigger disc whatever the circumstances. Efficient use of storage seems to be a weak area for the osx ecosystem but also the community. Aside from the cost and backup complications there is an environmental impact of being wasteful. Some improvements are being made with app trimming on iOS, so perhaps we'll see the same on OSX soon.


Yes, you can delete those files. The lowest risk are the ones in your user directory.


Also download the xcode dmg to a USB stick or network drive and install from there.


xcode 7.3 beta 3 needs something like 10gb + around 2-3gb for libraries, simulator support files etc.


Unfortunately this occurred for me when I had a big deadline the next day, causing me an extremely late night. I deleted Xcode then set about the libraries/simulators like I was no longer a developer. When I installed the new Xcode it put back the ones it needed.


I'd recommend keeping at least 5 gb free at all times. If this becomes a challenge, think about a new hd.


Dave

>I'm disappointed in the common community response


I can only speak for myself when I remind you that as a developer, it's should be an economic decision, wrapped in pragmatism. HD costs are lower than ever and when biased against my dev time, there is no contest in terms of ROI, especially given that I can't order more time off Amazon, regardless of price.


Disk space is just another asset - don't let it control you. Respect yourself as a developer first, by taking appropriate advantage of modern tech while you prioritize housekeeping accordingly. Never squander your dev time needlessly.

Very helpful article here on how to recover space from Xcode

http://blog.neverthesamecolor.net/how-to-recover-disk-space-from-xcode/

Thanks Dave! I agree, chastising folks who are looking for help isn't very helpful.

My laptop HD can't be upgraded and had a ton of useless xcode files consuming unnecessary disk space. Thanks to the blog that others have posted here, I was able to free up enough space to download and upgrade xcode. It appears that version I upgraded was a 4.5GB download, so I'm guessing that it requires about 4 times the spaces since I had to free up 20GB before it would install.

$: rm -fr ~/Library/Caches/storedownloadd
restart AppStore app
I had the same problem updating from Xcode 12 to Xcode 12.01 on a 13" MacBook Pro with 250 gb non-upgradable laptop.
  1. The system had 31 GB storage after all the steps described here had been taken, apps deleted, Xcode moved to iCloud. Documents, pictures, large files all moved to iCloud. Moving Xcode to iCloud did not free up disk space as one would imagine.

  2. Downloading of the Xcode 12.01 pix stopped after 7.09 GB had been downloaded.

  3. Searching for Xcode on App store and clicking on the icon said something like "there's not enough space on your disk to install Xcode". A more helpful message would specify how much storage is needed.

  4. The folder /Users/Shared had folders named "Relocated items" and "Previously Relocated items" that occupied 39 GB of storage. The read me in that folder explained that these files could not be moved into their original locations because of the upgrade. These are accumulated over successive upgrades and become huge.

  5. Deleting the files in /Users/Shared provided a total of 81 GB of free storage. After installing Xcode 12.01 the system has 64.91 GB with apps taking up 16.42 GB.

So I am still having this issue in 2021. I have seen the solution and it does not apply to me. I have 30GB free and a 1TB external hard drive will 100% of the space free. How the f can I download xcode? Really Apple, do you have to make all your software so hard to operate and a headache to deal with. I never use Apple because of this and now that I need to program in Swift I have to and run into all kinds of verbose errors when trying to install the correct software. How can I download xcode to my external HD? Apple if you're reading this you make POS software.

{deleted}

Xcode disk space requirements
 
 
Q