Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A handy script to clean up a mac thanks to - Gant Laborde's article: https://medium.freecodecamp.org/how-to-free-up-space-on-your-developer-mac-f542f66ddfb
# Cleanup old node_modules
echo "Cleaning node_modules in projects older than 30 days"
find . -name "node_modules" -type d -mtime +30 | xargs rm -rf
echo "Done cleaning node_modules"
# Clean up homebrew
echo "Clean homebrew"
brew update && brew upgrade && brew cleanup
echo "Done cleaning homebrew"
# Clean up outdated gems
echo "Clean gems"
gem cleanup
echo "Done cleaning gems"
# Clean up pod caches
echo "Clean up pod caches"
rm -rf "${HOME}/Library/Caches/CocoaPods"
echo "Done cleaning pod caches"
# Delete old XCode simulators
echo "Delete old XCode simulators"
xcrun simctl delete unavailable
echo "Done deleting old XCode simulators"
# Clean up xcode junk
echo "Clean XCode junk"
rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/iOS Device Logs/
echo "Done cleaning XCode junk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.