{
echo "will cite" | parallel --citation
} &>/dev/null
parallel --jobs 200% sudo rm -rf {} 2>/dev/null ::: ~/hostedtoolcache/*
brew update &>/dev/null
brew uninstall -q --force --zap --cask chromedriver firefox google-chrome julia microsoft-auto-update microsoft-edge session-manager-plugin r soundflower 2>/dev/null
brew uninstall -q --force --zap aliyun-cli ant aspell aws-sam-cli azure-cli bazelisk carthage composer fontconfig freetds freetype gcc@8 gd geckodriver gh gradle helm httpd hub jpeg libpq libtiff llvm maven mongodb-community mongodb-database-tools nginx node@14 openjdk packer php pipx postgresql python@3.8 rustup-init selenium-server-standalone subversion tidy-html5 unixodbc webp switchaudio-osx sox go ruby@2.7 2>/dev/null
brew upgrade 2>/dev/null
. ~/.bashrc &>/dev/null || true
brew cleanup -s && rm -rf $(brew --cache)
Note: The /Applications Volume seems to have slow I/O. So it will take much time to delete them.
Some XCode is outdated in macOS VM in GitHub Actions, so it needs to be cleaned and updated.
cd /System/Volumes/Data/Applications/
{
echo "will cite" | parallel --citation
} &>/dev/null
USED_XCODE=$(ls -lAog Xcode.app | awk -F'/' '{print $NF}')
for i in Xcode_10*.app Xcode_11*.app Xcode_12*.app; do
if [ $i != "$USED_XCODE" ]; then
printf "Removing %s...\n" "$i"
parallel --use-cpus-instead-of-cores --jobs 200% sudo rm -rf {} ::: ${i}/Contents/Developer/Platforms/*
parallel --use-cpus-instead-of-cores --jobs 200% sudo rm -rf {} ::: ${i}/Contents/*
sudo rm -rf ${i}
fi
done
cd -
parallel --jobs 200% sudo rm -rf {} 2>/dev/null ::: "/System/Volumes/Data/Applications/Visual Studio.app" ::: /Library/Frameworks/Mono.framework ::: /Library/Frameworks/Xamarin.Android.framework ::: /Library/Frameworks/Xamarin.Mac.framework ::: /Library/Frameworks/Xamarin.iOS.framework
parallel --jobs 200% sudo rm -rf {} 2>/dev/null ::: /Users/runner/Library/Developer/CoreSimulator/Caches/dyld/*