655

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?

Simon
  • 17,223
  • 1
  • 19
  • 23
Mostafa Addam
  • 6,956
  • 4
  • 20
  • 38
  • The latest versions of Android Studio for M1 chips have some errors. The following link may enable you to make a successful installation after completely removing existing installations. 1. https://programhub.net/install-android-studio-on-apple-silicon-m1-m1-pro-m1-max-macbooks/ 2. https://www.youtube.com/watch?v=0Mq560sg-Mw – Steven Mar 09 '22 at 02:40

7 Answers7

1593

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*
rm -Rf ~/Library/Caches/Google/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-sensitive1 (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)

ManWithBear
  • 2,787
  • 15
  • 27
Simon
  • 17,223
  • 1
  • 19
  • 23
  • 3
    Please add removing paths. Here is a complete thread about where path settings appear: http://stackoverflow.com/questions/7501678/set-environment-variables-on-mac-os-x-lion – user603749 Apr 02 '15 at 13:00
  • @Simon, Where is the Windows instructions? – Pacerier Jul 01 '15 at 10:59
  • @Pacerier I suggest you to open a new question at SF. I'm not a Windows user, but you can try to uninstall it from the control panel. – Simon Jul 02 '15 at 06:41
  • 9
    Also remove `/usr/local/var/lib/android-sdk/` folder. In my case it occupied 17G! – Sergey Gernyak Apr 20 '16 at 07:21
  • I think you'll also want to remove /usr/local/bin/adb. – aaronstacy Apr 22 '16 at 16:38
  • 8
    @Simon add this `rm -Rf ~/.AndroidStudio*` as well – Zeeshan Apr 29 '16 at 11:04
  • 2
    @ShanXeeshi i don't have this folder in my computer.. what is this folder about? – Simon Jul 09 '16 at 06:54
  • @Simon you must have this folder under your USER. May be you are checking on wrong path. Its under Users -> Your User Name – Zeeshan Jul 18 '16 at 21:11
  • +1 for @ShanXeeshi. I did have this directory : ~/.AndroidStudio1.5/ which needed to be removed. Simon: Great work for the perfect answer! – ND27 Sep 26 '16 at 19:22
  • You can also edit your path in your `.bash_profile` or `.zshrc` if you're using that. Mine had `Users/user/Library/Android/sdk/platform-tools:` and `Users/user/Librabry/Android/sdk/tools` in it. Those sections can be removed – Adzz Nov 22 '16 at 22:52
  • There is also the additional com.android.Emulator.plist file located in ~/Library/Preferences/ –  Dec 13 '16 at 11:45
  • if it wasn't for Apples amazing 2mb hard drives. – Pierre Jan 20 '17 at 09:05
  • @Simon, I used one command to install android sdk and didn't notice that there was one `--all` flag at the end, after half an hr i get a notification on my mac saying that I am running out of space. I did the steps mentioned above but only 15gb got free, before installing SDK through command line I had 80+gb free. How can I know where the sudo update android-sdk command would have saved the files? – Sahil Feb 22 '17 at 08:52
  • 2
    @sahil did you use homebrew to install the android-sdk? if so, use `brew uninstall android-sdk`. or try this handy tool for finding large files in your Mac www.derlien.com – Simon Feb 22 '17 at 17:31
  • @Simon I had this issue where when I executed **react-native run-android** it used to say you have not accepted license. I already had android studio and sdk, but then I did this command, `android update sdk --no-ui --all`, and then it took up 80gb in no time, then I followed your answer but could only get 15gb free. It still shows in my system that it has 90gb of data in it, although I only have few apps. – Sahil Feb 22 '17 at 17:40
  • @Simon that URL helped me, it showed the location of the folder with 67gb of data, dont know why it installed it there under `/usr/local/var/lib`, even android studio was not picking it up. – Sahil Feb 22 '17 at 17:58
  • What about `~/.emulator_console_auth_token` ? – Mustang Nov 20 '17 at 17:34
  • 1
    Don't forget environment variables – SadSeven Aug 08 '18 at 09:59
  • I think there is another "~/Library/Preferences/com.google.gct.plist" should be covered as well – steven Oct 31 '18 at 01:52
  • As for the SDK, mine was located at `~/Android/android-sdk-macosx`. – donarb Nov 09 '18 at 20:18
  • If you're working with NativeScript, then run also this `brew cask uninstall android-sdk` – Austris Cirulnieks Feb 18 '20 at 17:17
  • 2
    Newer versions of android studio use this directory `rm -Rf ~/Library/Application\ Support/Google/AndroidStudio*` – Isaac Paul Aug 31 '20 at 00:36
  • 1
    What about the Intel HAXM extension in `/Library/Extensions/intelhaxm.kext`? Appeared to be a later version of what Apple had installed. Also seems Apple signed their version *Apple Inc.* whereas the later version is signed *Intel Inc.* — which I have not allowed in System Preferences > Privacy & Security. – TimD Nov 15 '20 at 12:51
  • 1
    this too `rm -Rf ~/Library/Caches/Google/AndroidStudio*` – anasqadrei Oct 28 '21 at 21:45
  • If you installed Android Studio with Jetbrains Toolbox, you may need to remove the application with `rm -Rf ~/Applications/JetBrains\ Toolbox/Android\ Studio.app` instead. – Samueljh1 Jan 30 '23 at 18:27
71

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  
GoZoner
  • 67,920
  • 20
  • 95
  • 145
Joseph Mathew
  • 1,269
  • 15
  • 17
  • 4
    Note that it's a good idea to add comments on what each line does, for those who are skeptical of what the commands do, or for those who are curious. – Edric Dec 07 '18 at 07:41
  • also, if anyone not like to run the command then can use Shift + ⌘ + G on finder and paste the path to check the folder/file in finder. – Saurabh Prajapati Oct 06 '20 at 10:58
27

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*

ending0421
  • 1,214
  • 12
  • 8
19

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
quant24
  • 393
  • 6
  • 22
Ankit Sinha
  • 1,630
  • 1
  • 20
  • 19
15

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.

vijay
  • 831
  • 9
  • 14
12

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).

RFST
  • 147
  • 1
  • 5
0

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*

MikeFranks
  • 121
  • 3