介绍adb shell中一个很重要的命令——pm(Package Manager),这个命令主要用于获取和安装在 Android 设备上的应用信息。
关于pm命令的用法解析。命令行下输入adb shell pm即可获得关于pm的用法帮助,如下所示:

usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER]pm list permission-groupspm list permissions [-g] [-f] [-d] [-u] [GROUP]pm list instrumentation [-f] [TARGET-PACKAGE]pm list featurespm list librariespm list userspm path PACKAGEpm dump PACKAGEpm install [-lrtsfd] [-i PACKAGE] [PATH]pm install-create [-lrtsfdp] [-i PACKAGE] [-S BYTES]pm install-write [-S BYTES] SESSION_ID SPLIT_NAME [PATH]pm install-commit SESSION_IDpm install-abandon SESSION_IDpm uninstall [-k] [--user USER_ID] PACKAGEpm set-installer PACKAGE INSTALLERpm clear [--user USER_ID] PACKAGEpm enable [--user USER_ID] PACKAGE_OR_COMPONENTpm disable [--user USER_ID] PACKAGE_OR_COMPONENTpm disable-user [--user USER_ID] PACKAGE_OR_COMPONENTpm disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENTpm hide [--user USER_ID] PACKAGE_OR_COMPONENTpm unhide [--user USER_ID] PACKAGE_OR_COMPONENTpm grant PACKAGE PERMISSIONpm revoke PACKAGE PERMISSIONpm set-install-location [0/auto] [1/internal] [2/external]pm get-install-locationpm set-permission-enforced PERMISSION [true|false]pm trim-caches DESIRED_FREE_SPACEpm create-user [--profileOf USER_ID] [--managed] USER_NAMEpm remove-user USER_IDpm get-max-userspm list packages: prints all packages, optionally onlythose 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 onlythose 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; optionallysupply <TARGET-PACKAGE> to list the test packages for a particularapplication.  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-S: size in bytes of entire sessionpm install-write: write a package into existing session; path maybe '-' to read from stdin-S: size in bytes of package, required for stdinpm install-commit: perform install of fully staged session
pm install-abandon: abandon sessionpm set-installer: set installer package namepm 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 commandschange the enabled state of a given package or component (writtenas "package/class").pm grant, revoke: these commands either grant or revoke permissionsto applications.  Only optional permissions the application hasdeclared can be granted or revoked.pm get-install-location: returns the current install location.0 [auto]: Let system decide the best location1 [internal]: Install on internal device storage2 [external]: Install on external mediapm set-install-location: changes the default install location.NOTE: this is only intended for debugging; using this can causeapplications to break and other undersireable behavior.0 [auto]: Let system decide the best location1 [internal]: Install on internal device storage2 [external]: Install on external mediapm 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

我仅举例说明一些常用的命令,详细的可以参考上方的官方说明。

pm list 安装包名查询


  • adb shell pm list package 列出所有应用
  • adb shell pm list package -3 列出第三方应用
  • adb shell pm list instrumentation 列出所有测试包

pm dump 打印系统信息


adb shell pm dump PACKAGE_NAME

打印服务信息 解释
DUMP OF SERVICE activity activity信息
DUMP OF SERVICE meminfo 当前内存使用信息
DUMP OF SERVICE procstats 系统内存使用与一段时间内存汇总
DUMP OF SERVICE usagestats 服务器使用状态信息
DUMP OF SERVICE batterystats 电池状态信息
pm install 安装应用
pm unitall 卸载应用
pm clear 清除应用缓存

每天一个adb命令:pm 命令详解相关推荐

  1. Linux系统常用命令及其使用详解大全

    Linux系统常用命令及其使用详解大全 整理了linux常用的命令,最长常用的也就几十个,cd,ls ,vi等等,有些容易忘记,经常拿出来看看. 其他的可以推荐一个网站,https://www.lin ...

  2. 【转】Linux命令工具 top详解

    Linux命令工具 top详解 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.top是一个动态显示过程,即可以通过用户按键来不 ...

  3. Linux下fdisk命令操作磁盘详解--添加、删除、转换分区

    linux下fdisk命令操作磁盘详解--添加.删除.转换分区等 fdisk 操作硬盘的命令格式如下: [root@localhost beinan]# fdisk 设备 比如我们通过 fdisk - ...

  4. linux 软件 名称 更新,linux软件版本管理命令update-alternatives使用详解

    linux软件版本管理命令update-alternatives使用详解 update-alternatives 命令用于处理linux系统中软件版本的切换,在各个linux发行版中均提供了该命令,命 ...

  5. linux中top工具,Linux命令工具 top详解

    Linux命令工具 top详解 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.top是一个动态显示过程,即可以通过用户按键来不 ...

  6. linux 文件 字符集设置,Linux字符集和系统语言设置-LANG,locale,LC_ALL,POSIX等命令及参数详解...

    博文说明[前言]: 本文将通过个人口吻介绍Linux字符集和系统语言设置,包括LANG,locale,LC_ALL,POSIX等命令及参数详解的相关知识,在目前时间点[2017年6月21号]下,所掌握 ...

  7. MAC OS 命令行使用详解

    MAC OS 命令行使用详解:https://blog.csdn.net/sun375867463/article/details/9812317 1 为什么要使用命令行/如何开启命令行? 许多功能在 ...

  8. linux查看进程详细信息top,linux查看系统进程信息命令 px,top详解

    linux查看系统进程信息命令 px,top详解 发表于:2011-03-10来源:作者:点击数: linux查看系统进程信息命令 px,top详解 软件测试 ps ax命令是显示一个当前系统进程的列 ...

  9. 【Python】Python3.7.3 - Python命令行参数详解

    文章目录 Python命令行参数概览 -c cmd参数示例 -m mod参数示例 file参数示例 - 参数示例 命令行选项详解 -b 选项 -B选项 -d选项 -E选项 -h / -? / --he ...

  10. linux noprobe参数,find 命令的参数详解

    原标题:find 命令的参数详解 使用name选项 文件名选项是find命令最常用的选项,要么单独使用该选项,要么和其他选项一起使用. 可以使用某种文件名模式来匹配文件,记住要用引号将文件名模式引起来 ...

最新文章

  1. C++负数、小数如何保存
  2. C#和Sql Server 2005中时间的最大值和最小值
  3. 【直播预告】中外互联网大厂欢乐开撕:谁是技术界的嘴炮王者?
  4. ssh_exchange_identification: Connection closed by remote host解决方法
  5. Centos7.3 坑爹网络配置
  6. PoiDocxDemo【Android将表单数据生成Word文档的方案之二(基于Poi4.0.0),目前只能java生成】...
  7. 快速理解聚合根、实体、值对象的区别和联系
  8. php调用其他文件数组的值,PHP递归调用数组值并用其执行指定函数
  9. 推荐四款实用的局域网文件夹同步工具
  10. 图形推理1000题pdf_公务员考试:遇到图形推理题就烦恼?5招教你练成最强大脑...
  11. java web 04 jQuery jQuery api与jquery-1.7.2.js资料分享
  12. 无人深空java修改器,无人深空next存档修改-无人深空next存档修改器下载v1.5.0最新版-西西软件下载...
  13. 动易CMS 复制word里面带图文的文章,图片可以直接显示
  14. Vue 上传图片裁剪
  15. SnapGene快速入门,界面及常用操作教程
  16. 黑马登录案例验证码无法正常显示原因
  17. 2022年最好的游戏引擎是什么?
  18. OA项目实战学习(3)——实现岗位管理增删改查
  19. java红宝石是哪本_以月/年红宝石显示帖子
  20. 如何画一条0.5px的边(细线)

热门文章

  1. 伪标签Pseudo Label 与软标签 soft label
  2. vue3 + elementPlus 上传图片
  3. 全新第三代英特尔® 至强® 可扩展处理器重磅发布,点燃数字经济,应对万变挑战!
  4. iFunk翼真机曝光,实拍美爆了!
  5. 【优达学城测评】P3: Wrangle OpenStreetMap Data-Excel To CSV
  6. c语言版碟片出借系统代码,课程设计要用用C语言编写的图书管管理系统
  7. 关于Python装饰器的一些理解
  8. 西工大计算机学院优秀毕业生,榜样力量 你的女神是学霸——记航天学院2019届本科优秀毕业生蔡宜伦...
  9. 氧化硅片/锑化镓晶片介绍-供应钆镓石榴石(Gd3Ga5012)/砷化镓(GaAs)/钪酸钆(GdScO3)晶体基片
  10. 日常 VI 编辑总结