How to completely uninstall Android Studio on Mac?

MacosAndroid StudioUninstallation

Macos Problem Overview


I recently downloaded Android Studio on my Macbook Pro and I messed up with it every time I open it. It gives me plugin errors and several other errors. I need to uninstall it completely from my mac. I tried to delete it from my mac and then install it again as if you would do the first time, but it did nothing and now the same problems occur.

How can I manage to remove it completely and install a fresh one again?

Macos Solutions


Solution 1 - Macos

Execute these commands in the terminal (excluding the lines with hashtags - they're comments):

# Deletes the Android Studio application
# Note that this may be different depending on what you named the application as, or whether you downloaded the preview version
rm -Rf /Applications/Android\ Studio.app
# Delete All Android Studio related preferences
# The asterisk here should target all folders/files beginning with the string before it
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/Google/AndroidStudio*
# Deletes the Android Studio's plist file
rm -Rf ~/Library/Preferences/com.google.android.*
# Deletes the Android Emulator's plist file
rm -Rf ~/Library/Preferences/com.android.*
# Deletes mainly plugins (or at least according to what mine (Edric) contains)
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Application\ Support/Google/AndroidStudio*
# Deletes all logs that Android Studio outputs
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Logs/Google/AndroidStudio*
# Deletes Android Studio's caches
rm -Rf ~/Library/Caches/AndroidStudio*
# Deletes older versions of Android Studio
rm -Rf ~/.AndroidStudio*

If you would like to delete all projects:

rm -Rf ~/AndroidStudioProjects

To remove gradle related files (caches & wrapper)

rm -Rf ~/.gradle

Use the below command to delete all Android Virtual Devices(AVDs) and keystores.

Note: This folder is used by other Android IDEs as well, so if you still using other IDE you may not want to delete this folder)

rm -Rf ~/.android

To delete Android SDK tools

rm -Rf ~/Library/Android*

Emulator Console Auth Token

rm -Rf ~/.emulator_console_auth_token

Thanks to those who commented/improved on this answer!


Notes

  1. The flags for rm are case-sensitive[1](https://linuxacademy.com/community/posts/show/topic/7331-r-flag-vs-r-flag-and-case-sensitivity-question "See Linux Academy question for more info") (as with most other commands), which means that the f flag must be in lower case. However, the r flag can also be capitalised.
  2. The flags for rm can be either combined together or separated. They don't have to be combined.

What the flags indicate

  1. The r flag indicates that the rm command should- > attempt to remove the file hierarchy rooted in each file argument. - DESCRIPTION section on the manpage for rm (See man rm for more info)
  2. The f flag indicates that the rm command should- > attempt to remove the files without prompting for confirmation, regardless of the file's permissions. - DESCRIPTION section on the manpage for rm (See man rm for more info)

Solution 2 - Macos

Run the following commands in the terminal:

rm -Rf /Applications/Android\ Studio.app  
rm -Rf ~/Library/Preferences/AndroidStudio*  
rm -Rf ~/Library/Preferences/com.google.android.*  
rm -Rf ~/Library/Preferences/com.android.*  
rm -Rf ~/Library/Application\ Support/AndroidStudio*  
rm -Rf ~/Library/Logs/AndroidStudio*  
rm -Rf ~/Library/Caches/AndroidStudio*  
rm -Rf ~/.AndroidStudio*  
rm -Rf ~/.gradle  
rm -Rf ~/.android  
rm -Rf ~/Library/Android*  
rm -Rf /usr/local/var/lib/android-sdk/  

To delete all projects:

rm -Rf ~/AndroidStudioProjects  

Solution 3 - Macos

For someone using Android Studio 4.0 or above on MacOS 10.15.1 or above. Using command line blow:

# Deletes the Android Studio application
# Note that this may be different depending on what you named the application as, or whether you downloaded the preview version
rm -Rf /Applications/Android\ Studio.app
# Delete All Android Studio related preferences
# The asterisk here should target all folders/files beginning with the string before it
rm -Rf ~/Library/Preferences/Google/AndroidStudio*
# Deletes the Android Studio's plist file
rm -Rf ~/Library/Preferences/com.google.android.*
# Deletes the Android Emulator's plist file
rm -Rf ~/Library/Preferences/com.android.*
# Deletes mainly plugins (or at least according to what mine (Edric) contains)
rm -Rf ~/Library/Application\ Support/Google/AndroidStudio*
# Deletes all logs that Android Studio outputs
rm -Rf ~/Library/Logs/Google/AndroidStudio*
# Deletes Android Studio's caches
rm -Rf ~/Library/Caches/Google/AndroidStudio*
# Deletes older versions of Android Studio
rm -Rf ~/.AndroidStudio*

Difference

Library/Preferences/Google/AndroidStudio*

Library/Logs/Google/AndroidStudio*

Library/Caches/Google/AndroidStudio*

Solution 4 - Macos

I was also facing same kind of problem on my Macbook Pro. I took these very simple steps and freshly installed Android Studio.

** Link Contains Images, look if facing any problem.

These Very Simple Steps Can Solve Your Problem.

  1. Type "Command+option+Space Bar"
  2. Type "Android Studio"
  3. Click '+' button just below search box. image
  4. A new bar will come up "Kind" is "any" click on "kind" --> Others --> search for "system file" and select that by putting a tick mark.! And click on Ok. image
  5. Then select "are included" from the drop down menu !
  6. Then you get a lot of system file that need to be deleted to complete the fully un-installation of any app.
  7. Click "command+A" to select all files and take a look on the file remove is some video files are also included. And click "command + Delete"
  8. Empty your trash. Done

Solution 5 - Macos

You may also delete gradle file, if you don't use gradle any where else:

rm -Rfv ~/.gradle/

because .gradle folder contains cached artifacts that are no longer needed.

Solution 6 - Macos

Some of the files individually listed by Simon would also be found with something like the following command, but with some additional assurance about thoroughness, and without the recklessness of using rm -rf with wildcards:

find ~ \
  -path ~/Library/Caches/Metadata/Safari -prune -o \
  -iname \*android\*studio\* -print -prune

Also don't forget about the SDK, which is now separate from the application, and ~/.gradle/ (see vijay's answer).

Solution 7 - Macos

I chanced upon one other directory which should be deleted (had a date of April 2021 on my system):

rm -Rf ~/Library/Application\ Support/Android\ Open\ Source\ Project*

...and with credit to Hu1buerger of https://gist.github.com/talal/25d6b05b6969c2a8459b2b3abb86481f

rm -Rf ~/Library/Application\ Support/JetBrains*

Solution 8 - Macos

I am on macOS 12.1 x86_64, shell zsh 5.8 (x86_64-apple-darwin21.0)
Solved with interactive command.
Terminal asks to confirm delete y or n

Note: Different terminal login launch command provide the ability to lookup and remove different files. So I executed both three following ways

Without sudo
find / -name "*android*" -ok rm -Rf {} \;
With sudo
sudo find / -name "*android*" -ok rm -Rf {} \;

As root

sudo su
find / -name "*android*" -ok rm -Rf {} \;

After this if you use Homebrew and brew doctor throw some warning just Install Homebrew again

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMostafa AddamView Question on Stackoverflow
Solution 1 - MacosSimonView Answer on Stackoverflow
Solution 2 - MacosJoseph MathewView Answer on Stackoverflow
Solution 3 - Macosending0421View Answer on Stackoverflow
Solution 4 - MacosAnkit SinhaView Answer on Stackoverflow
Solution 5 - MacosvijayView Answer on Stackoverflow
Solution 6 - MacosRFSTView Answer on Stackoverflow
Solution 7 - MacosMikeFranksView Answer on Stackoverflow
Solution 8 - MacosAx_View Answer on Stackoverflow