-
-
Save mtavkhelidze/542144dcfca6dafba2307021942e03c4 to your computer and use it in GitHub Desktop.
How to completely remove Android Studio from Mac OS X
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
#!/usr/bin/env bash | |
# Remove Android Studio from your macOs | |
dry_run=true | |
while getopts "f" opt; do | |
case $opt in | |
f) | |
dry_run=false | |
echo "Removing..." | |
echo "Warning! This action is irreversible." | |
;; | |
*) | |
echo "Run with -f to force removal." | |
echo "Run without options to see what will be removed." | |
exit 1; | |
;; | |
esac | |
done | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
declare -a removables=( | |
/Applications/Android\ Studio.app | |
~/Library/Preferences/AndroidStudio* | |
~/Library/Preferences/com.google.android.studio.plist | |
~/Library/Application\ Support/AndroidStudio* | |
~/Library/Logs/AndroidStudio* | |
~/Library/Caches/AndroidStudio* | |
~/AndroidStudioProjects | |
~/.gradle | |
~/.android | |
~/Library/Android* | |
~/.android | |
) | |
if [ $dry_run = true ]; then | |
echo "These items will be removed:" | |
fi | |
for r in ${removables[@]}; do | |
if [ $dry_run = true ]; then | |
echo -e "\t$r" | |
else | |
echo "$r" | |
rm -fr "$r" | |
fi | |
done | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment