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

Answered by KMT in 56913022

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.

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

Xcode disk space requirements
 
 
Q