Skip to content

Instantly share code, notes, and snippets.

@danielrotaermel
Last active September 21, 2020 13:04
Show Gist options
  • Save danielrotaermel/3f0aa8a8ae288d21b39a1ef6f356db8d to your computer and use it in GitHub Desktop.
Save danielrotaermel/3f0aa8a8ae288d21b39a1ef6f356db8d to your computer and use it in GitHub Desktop.
A little script to reduce the size of Xcode by deleting unneeded platforms (tvOS, watchOS, ...) and Simulator Devices
#!/bin/bash
# Author: Daniel Rotärmel
du -sh ~/Library/Developer/Xcode
du -sh /Applications/Xcode.app
#du -sh ~/Library/Developer/Xcode/iOS\ DeviceSupport/ 2> /dev/null
#du -sh ~/Library/Developer/CoreSimulator/Devices/ 2> /dev/null
#du -sh /Applications/Xcode.app/Contents/Developer/Platforms/AppleTV* 2> /dev/null
#du -sh /Applications/Xcode.app/Contents/Developer/Platforms/Watch* 2> /dev/null
#du -sh /Applications/Xcode.app/Contents/Developer/Platforms/iPhone* 2> /dev/null
rm -rf ~/Library/Developer/CoreSimulator/Devices/*
rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTV*
rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/Watch*
# ios stuff
# rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhone*
# rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/
echo "disciplined Xcode"
du -sh ~/Library/Developer/Xcode
du -sh /Applications/Xcode.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment