Last active
September 29, 2022 13:14
-
-
Save Aidurber/7549d3f83b00052cee745a6c4dcf7b9d to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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