Skip to content

Instantly share code, notes, and snippets.

@isaax2
Last active June 9, 2024 19:25
Show Gist options
  • Save isaax2/9c3f600a6ce1598e4ec074162669e10d to your computer and use it in GitHub Desktop.
Save isaax2/9c3f600a6ce1598e4ec074162669e10d to your computer and use it in GitHub Desktop.
Free Space Xcode Mac
#!/usr/bin/env bash
#Solid state drives are an awesome performance booster. But unfortunately, they are more expensive and naturally come in smaller capacities than hard disk drives. Check these directories Xcode uses and see if you can delete some stuff:
#~/Library/Developer/Xcode/DerivedData/ - It's totally safe to delete directories here. Especially for projects that you no longer need. When you rebuild your project, they will be created for you.
#~/Library/Developer/Xcode/iOS DeviceSupport/ - a folder for each combination of iOS (physical) device you have plugged in and the iOS version you were running on it. If you have been doing iOS developer for a while, you will have accrued quite a number of these folders that you can remove. They will be re-generated for you when you plug in a device if you accidentally delete a more recent folder.
#You can easily reclaim a couple of gigs to tens of gigs of space by cleaning up these 2 directories.
rm -rvf ~/Library/Developer/Xcode/DerivedData/
rm -rvf ~/Library/Developer/Xcode/iOS DeviceSupport/
#Credits:
#http://hboon.com/iosdevnuggets/ios-dev-nugget-162-reclaim-disk-space-from-xcode-usage/
#Remove the entire folder to install a new Xcode Version
#rm -rvf ~/Library/Developer
rm -rvf ~/Library/Developer/Core\ Simulator
#from https://developer.apple.com/forums/thread/124031?page=2
# sudo rm -rvf /Library/Developer
# rm -rvf ~/Library/Developer
# https://hangzone.com/free-space-xcode-android-studio/
xcrun simctl delete unavailable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment