Skip to content

Instantly share code, notes, and snippets.

@kanav99
Created May 7, 2021 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanav99/96d3dd1f980a79bbb5f40693024497a2 to your computer and use it in GitHub Desktop.
Save kanav99/96d3dd1f980a79bbb5f40693024497a2 to your computer and use it in GitHub Desktop.
Xcode Cleanup - Remove All files not needed for macOS development

I use Xcode only for macOS development, not for iOS, TVOS or WatchOS development. They take up most of the space in Xcode. I will show which files to delete to save atleast 20 Gb of space (as of Xcode 12.5) Run all commands as sudo

cd /Applications/Xcode.app/Contents/Developer/Platforms 
rm -rf AppleTVOS.platform
rm -rf AppleTVSimulator.platform
rm -rf iPhoneOS.platform
rm -rf iPhoneSimulator.platform
rm -rf WatchOS.platform
rm -rf WatchSimulator.platform

You can also remove your user CoreSimulator cache

rm -rf ~/Library/Developer/CoreSimulator

If you had CommandLineTools installed before Xcode, you don't need it anymore.

rm -rf /Library/Developer/CommandLineTools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment