Android 不需要root权限也可卸载系统应用的adb命令

 

重要提醒:

卸载某个系统应用之前,需要先通过 apk提取器 或 ES文件浏览器 工具 将系统应用进行备份,以防止被卸载后,导致手机出现问题,若出现问题,还可以有机会重新安装回来,切记

 

一个不需要root权限也可卸载系统应用的adb命令

方法一(推荐):

adb shell pm uninstall [-k] [--user USER_ID] 包名

参数说明:

  • k 卸载应用且保留数据与缓存,如果不加 -k 则全部删除。

  • user 指定用户 id,Android 系统支持多个用户,默认用户只有一个,id=0。

可以用这个命令,user 和 debug 版本都可以用,所有应用都能卸载掉。

比如这里卸载 360 浏览器:

adb shell pm uninstall -k --user 0 com.qihoo.browser

看到 Success 字样,代表卸载成功。

 

方法二: disable应用(disable应用后,应用并没有被卸载,只是桌面没有图标了;hide 命令可以卸载应用,保留数据,但是运行失败)

C:\Users\zz>adb shell pm hide --user 0 com.sec.android.easyMover
Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_USERS.

 

通过命令:adb shell pm disable-user --user 0  包名

C:\Users\zz>adb shell pm disable-user --user 0 com.sec.android.easyMover
Package com.sec.android.easyMover new state: disabled-user

C:\Users\zz>adb shell pm enable --user 0 com.sec.android.easyMover
Package com.sec.android.easyMover new state: enabled

 

例如:

C:\Users\zz>adb shell pm uninstall  com.redstone.ota.ui  // 无法卸载
Failure [DELETE_FAILED_INTERNAL_ERROR]

C:\Users\zz>adb shell pm uninstall --user 0 com.redstone.ota.ui  //添加 --user 参数后,便能卸载成功
Success

 

Q&A

  1. 我想卸载某个应用,但不知道这个应用包名?

   打开应用,执行如下命令(linux系统):

adb shell dumpsys window | grep mCurrentFocus


打开应用,执行如下命令(window系统):

adb shell dumpsys window | findstr mCurrentFocus

 

  1. 我把一些系统应用卸载了,怎么恢复?

可以通过恢复出厂设置方式恢复。

 

 

 

海外手机一键卸载无用的app

一键批量卸载apk.bat

内容:

@ECHO OFF
CLS
color 0a



adb shell pm uninstall --user 0	com.google.android.youtube
adb shell pm uninstall --user 0	com.google.android.googlequicksearchbox
adb shell pm uninstall --user 0	com.google.android.gm
adb shell pm uninstall --user 0	com.google.android.apps.docs
adb shell pm uninstall --user 0	com.google.android.apps.maps
adb shell pm uninstall --user 0	com.google.android.videos
adb shell pm uninstall --user 0	com.google.android.apps.photos
adb shell pm uninstall --user 0	com.google.android.calendar
adb shell pm uninstall --user 0	com.google.android.gms.location.history
adb shell pm uninstall --user 0	com.google.android.apps.youtube.music
adb shell pm uninstall --user 0	com.google.android.apps.googleassistant
adb shell pm uninstall --user 0	com.google.android.apps.tachyon
adb shell pm uninstall --user 0	cn.com.blacksesame.stereocalib
adb shell pm uninstall --user 0	com.debug.loggerui

 

posted @ 2021-04-02 16:50  行走的思想  阅读(4977)  评论(0编辑  收藏  举报