All Posts by Date or last 15, 30, 90 or 180 days.

As an Amazon Associate I earn from qualifying purchases @AMAZON

Designed for the most demanding needs of photographers and videographers.
Connect and charge all of your devices through a single Thunderbolt or USB-C port.

Saving up to 8.5GB of Space After Every Apple Xcode Update

See my Mac wish list at B&H Photo.

8.87GB of XCode platforms (default install)

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 Platforms 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 Platforms folder now occupies only 0.41GB instead of 8.87GB, a savings of 8.46GB. Want more?

# 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.

8.5GB space savings removing unused XCode platforms
View all handpicked deals...

Seagate 22TB IronWolf Pro 7200 rpm SATA III 3.5" Internal NAS HDD (CMR)
$500 $400
SAVE $100

diglloyd.com | Terms of Use | PRIVACY POLICY
Contact | About Lloyd Chambers | Consulting | Photo Tours
Mailing Lists | RSS Feeds | X.com/diglloyd
Copyright © 2020 diglloyd Inc, all rights reserved.
Display info: __RETINA_INFO_STATUS__