如何在 Mac 上完全卸载 Android Studio? [英] How to completely uninstall Android Studio on Mac?

查看:45
本文介绍了如何在 Mac 上完全卸载 Android Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的 Macbook Pro 上下载了 Android Studio,每次打开它时我都搞砸了.它给了我插件错误和其他几个错误.我需要从我的 mac 上完全卸载它.我试图从我的 mac 中删除它,然后像第一次一样重新安装它,但它什么也没做,现在出现了同样的问题.

我如何才能完全删除它并重新安装一个新的?

解决方案

在终端中执行这些命令(不包括带有主题标签的行 - 它们是注释):

# 删除Android Studio应用# 请注意,这可能会有所不同,具体取决于您将应用程序命名为什么,或者您是否下载了预览版rm -Rf/Applications/Android\ Studio.app# 删除所有与 Android Studio 相关的首选项# 这里的星号应该指向所有以它之前的字符串开头的文件夹/文件rm -Rf ~/Library/Preferences/AndroidStudio*rm -Rf ~/Library/Preferences/Google/AndroidStudio*# 删除Android Studio的plist文件rm -Rf ~/Library/Preferences/com.google.android.*# 删除Android模拟器的plist文件rm -Rf ~/Library/Preferences/com.android.*# 主要删除插件(或至少根据我的(Edric)包含的内容)rm -Rf ~/Library/Application\ Support/AndroidStudio*rm -Rf ~/Library/Application\ Support/Google/AndroidStudio*# 删除Android Studio输出的所有日志rm -Rf ~/Library/Logs/AndroidStudio*rm -Rf ~/Library/Logs/Google/AndroidStudio*# 删除 Android Studio 的缓存rm -Rf ~/Library/Caches/AndroidStudio*# 删除旧版本的 Android Studiorm -Rf ~/.AndroidStudio*

如果您想删除所有项目:

rm -Rf ~/AndroidStudioProjects

删除与 gradle 相关的文件(缓存和包装器)

rm -Rf ~/.gradle

使用以下命令删除所有 Android 虚拟设备(AVD) 和密钥库.

注意:这个文件夹也被其他Android IDE使用,所以如果你还在使用其他IDE,你可能不想删除这个文件夹)

rm -Rf ~/.android

删除Android SDK工具

rm -Rf ~/Library/Android*

模拟器控制台身份验证令牌

rm -Rf ~/.emulator_console_auth_token

感谢对这个答案发表评论/改进的人!


注意事项

  1. rm 的标志区分大小写1(与大多数其他命令一样),这意味着f 标志必须为小写.但是,r 标志也可以大写.
  2. rm 的标志可以组合在一起或分开.它们不必组合在一起.

标志的含义

  1. r 标志表示 rm 命令应该-<块引用>

    a尝试删除以每个文件参数为根的文件层次结构. - rm 联机帮助页上的 DESCRIPTION 部分(请参阅 man rm 了解更多信息)

  2. f 标志表示 rm 命令应该-<块引用>

    a尝试在不提示确认的情况下删除文件,无论文件的权限如何. - rm 联机帮助页上的 DESCRIPTION 部分(更多信息见man rm)

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?

解决方案

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

这篇关于如何在 Mac 上完全卸载 Android Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆