Friday, March 29, 2019

Reclaiming Disk Space From Xcode

Julio Carrettoni:

If you are an iOS developer, execute this:

$ xcrun simctl delete unavailable

It removes old simulators Xcode no longer use. For me it was 6Gb

[…]

You can also delete ~/Library/Developer/Xcode/Device Support If you want to gain back more space.

Xcode will regenerate what’s needed

Russ Bishop:

Be careful; if you switch Xcode versions then Simulators for “other” versions of iOS can show as unavailable.

Fabio Giolito:

my “freespace” alias:

sudo rm -rf /.DocumentRevisions-V100/
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/Archives 
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
rm -rf ~/Library/Caches/com.apple.dt.Xcode
xcrun simctl delete unavailable

Julio Carrettoni:

I guess you ran out of characters, but don’t forget to also nuke watchOS DeviceSupport and tvOS DeviceSupport

3 Comments RSS · Twitter


Aren’t archives required to symbolicate crash logs?


Wow. I've got a 2013 MacBook Air with a 256Gig drive that always seems to be within 20 or 30 Gigs of being full. Every few weeks I have to spend an hour or so laboriously looking for stuff to delete. I tried Fabio's recommended script above and recovered how much space you ask? Hard to believe, but I just freed up 100 Gig. Holy shit, Batman! I'm a very happy camper. :-)


Leave a Comment