adb shell 命令之----pm

摘要:
常用的用法:查看已经安装的包:pmlistpackages查看已经安装的包以及apk路径(-3:只看第三方应用;-s:只看系统应用)-f:seetheirassociatedfile.-d:filtertoonlyshowdisbledpackages.-e:filtertoonlyshowenabledpackages.-s:filtertoonlyshowsystempackages.-3:f

常用的用法:

查看已经安装的包: pm list packages

查看已经安装的包以及apk路径(-3:只看第三方应用; -s:只看系统应用)

-f: see their associated file.
-d: filter to only show disbled packages.
-e: filter to only show enabled packages.
-s: filter to only show system packages.
-3: filter to only show third party packages.

pm list packages -f -3:列出指定包名的APK位置

pm path com.kp.poi :删除某个应用的所有数据(相当于全新安装)

pm clear com.UCMobile:禁用/启用某个应用(disable/enable)

pm disable com.android.systemui:列出硬件信息:pm list features

完整的用法:
C:UsersAdministrator>adb shell pm
usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER]
pm list permission-groups
pm list permissions [-g] [-f] [-d] [-u] [GROUP]
pm list instrumentation [-f] [TARGET-PACKAGE]
pm list features
pm list libraries
pm list users
pm path PACKAGE
pm dump PACKAGE
pm install [-lrtsfd] [-i PACKAGE] [--user USER_ID] [PATH]
pm install-create [-lrtsfdp] [-i PACKAGE] [-S BYTES]
[--install-location 0/1/2]
[--force-uuid internal|UUID]
pm install-write [-S BYTES] SESSION_ID SPLIT_NAME [PATH]
pm install-commit SESSION_ID
pm install-abandon SESSION_ID
pm uninstall [-k] [--user USER_ID] PACKAGE
pm set-installer PACKAGE INSTALLER
pm move-package PACKAGE [internal|UUID]
pm move-primary-storage [internal|UUID]
pm clear [--user USER_ID] PACKAGE
pm enable [--user USER_ID] PACKAGE_OR_COMPONENT
pm disable [--user USER_ID] PACKAGE_OR_COMPONENT
pm disable-user [--user USER_ID] PACKAGE_OR_COMPONENT
pm disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENT
pm hide [--user USER_ID] PACKAGE_OR_COMPONENT
pm unhide [--user USER_ID] PACKAGE_OR_COMPONENT
pm grant [--user USER_ID] PACKAGE PERMISSION
pm revoke [--user USER_ID] PACKAGE PERMISSION
pm reset-permissions
pm set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined}
pm get-app-link [--user USER_ID] PACKAGE
pm set-install-location [0/auto] [1/internal] [2/external]
pm get-install-location
pm set-permission-enforced PERMISSION [true|false]
pm trim-caches DESIRED_FREE_SPACE [internal|UUID]
pm create-user [--profileOf USER_ID] [--managed] USER_NAME
pm remove-user USER_ID
pm get-max-users

pm list packages: prints all packages, optionally only
those whose package name contains the text in FILTER. Options:
-f: see their associated file.
-d: filter to only show disbled packages.
-e: filter to only show enabled packages.
-s: filter to only show system packages.
-3: filter to only show third party packages.
-i: see the installer for the packages.
-u: also include uninstalled packages.

pm list permission-groups: prints all known permission groups.

pm list permissions: prints all known permissions, optionally only
those in GROUP. Options:
-g: organize by group.
-f: print all information.
-s: short summary.
-d: only list dangerous permissions.
-u: list only the permissions users will see.

pm list instrumentation: use to list all test packages; optionally
supply to list the test packages for a particular
application. Options:
-f: list the .apk file for the test package.

pm list features: prints all features of the system.

pm list users: prints all users on the system.

pm path: print the path to the .apk of the given PACKAGE.

pm dump: print system state associated with the given PACKAGE.

pm install: install a single legacy package
pm install-create: create an install session
-l: forward lock application
-r: replace existing application
-t: allow test packages
-i: specify the installer package name
-s: install application on sdcard
-f: install application on internal flash
-d: allow version code downgrade
-p: partial application install
-g: grant all runtime permissions
-S: size in bytes of entire session

pm install-write: write a package into existing session; path may
be '-' to read from stdin
-S: size in bytes of package, required for stdin

pm install-commit: perform install of fully staged session
pm install-abandon: abandon session

pm set-installer: set installer package name

pm uninstall: removes a package from the system. Options:
-k: keep the data and cache directories around after package removal.

pm clear: deletes all data associated with a package.

pm enable, disable, disable-user, disable-until-used: these commands
change the enabled state of a given package or component (written
as "package/class").

pm grant, revoke: these commands either grant or revoke permissions
to apps. The permissions must be declared as used in the app's
manifest, be runtime permissions (protection level dangerous),
and the app targeting SDK greater than Lollipop MR1.

pm reset-permissions: revert all runtime permissions to their default state.

pm get-install-location: returns the current install location.
0 [auto]: Let system decide the best location
1 [internal]: Install on internal device storage
2 [external]: Install on external media

pm set-install-location: changes the default install location.
NOTE: this is only intended for debugging; using this can cause
applications to break and other undersireable behavior.
0 [auto]: Let system decide the best location
1 [internal]: Install on internal device storage
2 [external]: Install on external media

pm trim-caches: trim cache files to reach the given free space.

pm create-user: create a new user with the given USER_NAME,
printing the new user identifier of the user.

pm remove-user: remove the user with the given USER_IDENTIFIER,
deleting all data associated with that user

免责声明:文章转载自《adb shell 命令之----pm》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇十七、SAP中使用SQL语句读取一条数据Ubuntu18.04.2 amd64编译安装libcurl支持https下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Activator.CreateInstance 方法 (Type) 的用法

转自:http://www.cnblogs.com/lmfeng/archive/2012/01/30/2331666.html Activator.CreateInstance 方法 (Type) 的用法  Activator.CreateInstance 方法 (Type)  使用与指定参数匹配程度最高的构造函数来创建指定类型的实例。 命名空间...

shell 常用脚本维护笔记

Centos7.5 IP地址维护 #!/usr/bin/bash IPADDR=$(ifconfig|grep inet|sed '2,$d'|awk '{print $2}') GATEWAY=$(ifconfig|grep inet|sed '2,$d'|awk '{print $2}'|awk -F "." '{print $1"."$2"."$3"...

Day7-PXE安装系统

PXE     Pre-boot eXecuionEnvironment     预启动执行环境,在操作系统之前运行     可用于远程安装、构建无盘工作站 工作模式     PXE client集成在网卡ROM中     在计算机引导时,BIOS把PXE client 调入内存执行,获取PXE server 配置、显示菜单,根据用户选择将远程操作系统下...

Android属性之build.prop生成过程

Android属性之build.prop生成过程此部分网上这篇文章分析的不错: http://blog.csdn.net/thl789/article/details/7014300 转载过来 Android的build.prop文件是在Android编译时刻收集的各种property(LCD density/语言/编译时间, etc.),编译完成之后,...

计算机是怎样启动的?

从打开电源到開始操作。计算机的启动是一个很复杂的过程。 我一直搞不清楚,这个过程究竟是怎么回事。仅仅看见屏幕高速滚动各种提示...... 这几天,我查了一些资料。试图搞懂它。以下就是我整理的笔记。 零、boot的含义 先问一个问题。"启动"用英语怎么说? 回答是boot。但是,boot原来的意思是靴子,"启动"与靴子有什么关系呢? 原来,这里的boo...

Apache Kylin远程代码执行漏洞复现(CVE-2020-1956)

Apache Kylin远程代码执行漏洞复现(CVE-2020-1956) 简介 Apache Kylin 是美国 Apache 软件基金会的一款开源的分布式分析型数据仓库。该产品主要提供 Hadoop/Spark 之上的 SQL 查询接口及多维分析(OLAP)等功能。 Apache Kylin 中的静态 API 存在安全漏洞。攻击者可借助特制输入利用该漏...