Saving up to 8.5GB of Space After Every Apple Xcode Update
See my Mac wish list at B&H Photo.

As a developer, I 'enjoy' frequent Apple XCode updates—roughly a 5GB download of which 90% is nothing I ever use (iOS and Apple TV and WatchOS platforms); I need Xcode support only for macOS development (the latest 'upgrade' crashes 100% of the time building diglloydTools...sigh). Yet the XCode updater insists on downloading and installing all development platforms, even for minor updates.
I wouldn’t care if the space used weren’t so substantial, but anyone with a 128GB or 256GB or 512GB SSD might care, as I do.
In my travel laptop I currently have only a 512GB flash drive (which is really only 500GB). Because of fixed requirements (stuff I absolutely must have onboard), my typical free space is only around 180GB. Space has gotten so tight on some photography trips* that I have been forced into external overflow storage which I greatly prefer to avoid as it greatly complicates working and backing up in the field, and is physically awkward in a car, more devices to carry, etc).
As shown at right, the Xcode
folder uses 8.87 GB of space, of which about 8.5GB are platform support folders that I never use. That represents nearly 5% of the available free space on my laptop, so it makes sense to reclaim it.Here’s how I reclaim the space after XCode is updated by removing unused platform support folders. Commands are shown in blue, as used in Terminal.
diglloydMP:MPG lloyd$ cd /Applications/Xcode.app/Contents/Developer/Platforms/ diglloydMP:Platforms lloyd$ sudo rm -rf AppleTV* Watch* iPhone*
After the above removal, the savings of 8.46GB. Want more?
folder now occupies only 0.41GB instead of 8.87GB, a# OPTIONAL: save another half-gigabyte if not using SWIFT: diglloydMP:Developer lloyd$ sudo rm -rf /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain # OPTIONAL: save another 3.1GB by removing (not always this large, but can be) diglloydMP:~ lloyd$ rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/ # OPTIONAL: remove support for iPhone/iPad/etc simulators (up to another gigabyte or so) diglloydMP:~ lloyd$ rm -rf ~/Library/Developer/CoreSimulator/Devices/*
That’s a total savings of 12GB! It speaks to incoherent software management that Apple pushes complex (and potentially dangerous) cloud-based solutions for saving space in macOS Sierra without first eliminating the brain-dead space-wasting XCode behavior. The solution is obvious: install an inner core Xcode, then allow the user to add on whatever platforms and support are wanted. Don’t just shovel out unwanted bloatware.
Obviously one must not remove platform support needed for code development for that platform. But if like me you develop for only one or two of the platforms, space can be reclaimed. There aren’t that many “free lunches” for getting back that much space.
The 2016 MacBook Pro I’ve ordered with the 2TB SSD—I’m not going to make the same mistake twice (going with too small an SSD). Update: returned it for reasons unrelated to the SSD.
