本文翻译自: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? 我怎样才能完全删除它并重新安装一个新的?
参考:https://stackoom.com/question/1BxEE/如何在Mac上完全卸载Android-Studio
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! 感谢那些对此答案进行评论/改进的人!
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
标志也可以大写。 rm
can be either combined together or separated. rm
的标志可以组合在一起或分开。 They don't have to be combined. 它们不必合并。 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
(Seeman rm
for more info) - 有关rm
的联机帮助页的描述部分(有关详细信息,请参阅man rm
)
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
(Seeman rm
for more info) - 有关rm
的联机帮助页的描述部分(有关详细信息,请参阅man rm
)
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文件夹包含不再需要的缓存工件。
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的回答)。
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. 这些非常简单的步骤可以解决您的问题。
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