如何在Mac上完全卸载Android Studio?

本文翻译自:How to completely uninstall Android Studio on Mac?

I recently downloaded Android Studio on my Macbook Pro and I messed up with it every time I open it. 我最近在我的Macbook Pro上下载了Android Studio,每次打开它时都会搞砸它。 It gives me plugin errors and several other errors. 它给了我插件错误和其他几个错误。 I need to uninstall it completely from my mac. 我需要从我的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. 我试图从我的mac中删除它,然后再次安装,就像你第一次做的那样,但它没有做任何事情,现在出现了同样的问题。

How can I manage to remove it completely and install a fresh one again? 我怎样才能完全删除它并重新安装一个新的?


#1楼

参考:https://stackoom.com/question/1BxEE/如何在Mac上完全卸载Android-Studio


#2楼

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*
# 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*
# Deletes all logs that Android Studio outputs
rm -Rf ~/Library/Logs/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) 删除与gradle相关的文件(缓存和包装器)

rm -Rf ~/.gradle

Use the below command to delete all Android Virtual Devices (AVDs) and keystores. 使用以下命令删除所有Android虚拟设备 (AVD)和密钥库。

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) 注意 :此文件夹也被其他Android IDE使用,因此如果您仍在使用其他IDE,则可能不想删除此文件夹)

rm -Rf ~/.android

To delete Android SDK tools 删除Android SDK工具

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 (as with most other commands), which means that the f flag must be in lower case. rm的标志区分大小写1 (与大多数其他命令一样),这意味着f标志必须为小写。 However, the r flag can also be capitalised. 但是, r标志也可以大写。
  2. The flags for rm can be either combined together or separated. rm的标志可以组合在一起或分开。 They don't have to be combined. 它们不必合并。

What the flags indicate 标志表示什么

  1. The r flag indicates that the rm command should- r标志表示rm命令应该 -

    a ttempt to remove the file hierarchy rooted in each file argument. 尝试删除以每个文件参数为根的文件层次结构。 - DESCRIPTION section on the manpage for rm (See man rm for more info) - 有关rm的联机帮助页的描述部分(有关详细信息,请参阅man rm

  2. The f flag indicates that the rm command should- f标志表明rm命令应该 -

    a ttempt 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) - 有关rm的联机帮助页的描述部分(有关详细信息,请参阅man rm


#3楼

You may also delete gradle file, if you don't use gradle any where else: 如果您不在任何其他地方使用gradle,您也可以删除gradle文件:

rm -Rfv ~/.gradle/

because .gradle folder contains cached artifacts that are no longer needed. 因为.gradle文件夹包含不再需要的缓存工件。


#4楼

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: Simon单独列出的一些文件也可以使用类似下面的命令找到,但是有一些关于彻底性的额外保证,并且没有将rm -rf与通配符一起使用的鲁莽性:

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). 另外不要忘记现在与应用程序分开的SDK和〜/ .gradle /(参见vijay的回答)。


#5楼

I was also facing same kind of problem on my Macbook Pro. 我的Macbook Pro上也遇到了同样的问题。 I took these very simple steps and freshly installed Android Studio. 我采取了这些非常简单的步骤并重新安装了Android Studio。

** Link Contains Images, look if facing any problem. ** 链接包含图像,看看是否面临任何问题。

These Very Simple Steps Can Solve Your Problem. 这些非常简单的步骤可以解决您的问题。

  1. Type "Command+option+Space Bar" 输入“Command + option + Space Bar”
  2. Type "Android Studio" 输入“Android Studio”
  3. Click '+' button just below search box. 点击搜索框下方的“+”按钮。
  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.! 一个新栏将出现“Kind”是“任意”点击“kind” - >其他 - >搜索“系统文件”并通过勾选标记来选择。 And click on Ok. 然后单击确定。
  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. 单击“命令+ A”以选择所有文件并查看文件删除是否还包括一些视频文件。 And click "command + Delete" 然后单击“命令+删除”
  8. Empty your trash. 清空你的垃圾。 Done 完成

#6楼

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  

你可能感兴趣的:(macos,android-studio,uninstall)