Skip to content

Instantly share code, notes, and snippets.

@hvsw
Created December 15, 2020 14:24
Show Gist options
  • Save hvsw/32a7ed7b8c62a2632b03f327e0a20e59 to your computer and use it in GitHub Desktop.
Save hvsw/32a7ed7b8c62a2632b03f327e0a20e59 to your computer and use it in GitHub Desktop.
macOS developer free space
function freespace() {
# rm -rf ~/Library/Containers/com.apple.mail/Data/Library/Mail\ Downloads/
# https://stackoverflow.com/a/53199763/3724306
echo "1. Boot all the sims that I want to use"
echo "2. remove all the simulators that I don't have booted"
echo "Run: xcrun simctl list | grep -w \"Shutdown\" | grep -o \"([-A-Z0-9]*)\" | sed \'s/[\(\)]//g\\' | xargs -I uuid xcrun simctl delete uuid"
echo "Cleaning ~/Library/Caches/com.apple.dt.Xcode..."
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
echo "Cleaning ~/Library/Developer/Xcode/DerivedData..."
rm -rf ~/Library/Developer/Xcode/DerivedData/*
echo "Cleaning ~/Library/Developer/Xcode/iOS Device Logs..."
rm -rf ~/Library/Developer/Xcode/iOS\ Device\ Logs/*
echo "Cleaning ~/Library/Developer/Xcode/Archives..."
rm -rf ~/Library/Developer/Xcode/Archives/*
echo "Check if you want to remove any of these:"
ls -l ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
ls -l ~/Library/Developer/CoreSimulator/Caches/*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment