Created
July 25, 2025 19:50
-
-
Save jongan69/e24d90ab5506feaf9a7b945e28aa0da6 to your computer and use it in GitHub Desktop.
clean up on mac
This file contains hidden or 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
#!/bin/bash | |
echo "🔧 Starting Mac dev cleanup..." | |
# 1. Clear User & System Cache | |
echo "🧹 Clearing system and user caches..." | |
sudo rm -rf ~/Library/Caches/* /Library/Caches/* | |
# 2. Xcode Derived Data | |
echo "🧹 Removing Xcode Derived Data..." | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
# 3. iOS Simulators | |
echo "🧹 Deleting unavailable iOS Simulators..." | |
xcrun simctl delete unavailable | |
# 4. CoreSimulator device junk | |
echo "🧹 Removing CoreSimulator devices..." | |
rm -rf ~/Library/Developer/CoreSimulator/Devices/* | |
# 5. System logs | |
echo "🧹 Clearing system logs..." | |
sudo rm -rf /private/var/log/* | |
# 6. Docker cleanup | |
echo "🐳 Cleaning Docker..." | |
docker system prune -af --volumes | |
# 7. NPM/Yarn cache | |
echo "📦 Cleaning NPM/Yarn cache..." | |
npm cache clean --force | |
yarn cache clean | |
# 8. Homebrew cache | |
echo "🍺 Cleaning Homebrew cache..." | |
brew cleanup -s | |
rm -rf "$(brew --cache)" | |
# 9. Trash | |
echo "🗑️ Emptying Trash..." | |
sudo rm -rf ~/.Trash/* | |
echo "✅ Done! Restart recommended to flush memory." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bash <(curl -s https://gist.githubusercontent.com/jongan69/e24d90ab5506feaf9a7b945e28aa0da6/raw/0cecaf1f92d79041a7fe141a83d9302331725304/cleanup.sh)