常用的用法:

查看已经安装的包: 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:\Users\Administrator>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的更多相关文章

  1. 【原创】Android开发之ADB及ADB SHELl命令的应用

    adb的全称为Android Debug Bridge,就是起到调试桥的作用.通过adb我们可以在Eclipse中方面通过DDMS来调试Android程序,说白了就是debug工具.adb的工作方式比 ...

  2. 【android】android 常用adb 和 adb shell 命令

    db是SDK自带的工具,可实现桥接功能:adb shell 可以与手机系统建立交互,是基于andoid Linux系统下的操作 ADB常用命令: 1. 查看设备         adb  device ...

  3. ubuntu 使用adb shell命令识别android设备

    ubuntu 使用adb shell命令配置 在ubuntu下使用adb 命令识别Android设备需配置adb_usb.ini 文件 文件路径:  ~/.android/ ,若不存在创建该文件. a ...

  4. adb shell 命令详解,android

    http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...

  5. 【安卓手机通用】android adb shell 命令大全

    浏览:3116 | 更新:2013-10-17 17:05 | 标签:安卓 android 一.[什么是shell] Linux系统的shell作为操作系统的外壳,为用户提供使用操作系统的接口.它是命 ...

  6. Android 执行 adb shell 命令

    Android 执行Adb shell 命令大多需要root权限,Android自带的Runtime. getRuntime().exec()容易出错,在网上找到了一个执行adb shell命令的类 ...

  7. adb shell命令后出现error: device not found错误提示

    在cmd中输入adb shell进入linux shell环境前,需要把android模拟器打开(本文都是针对模拟器而言,并非真机).如果启动好了模拟器,且输入adb shell命令后出现error: ...

  8. Android 通过adb shell命令查看内存,CPU,启动时间,电量等信息

    Android 通过adb shell命令查看内存,CPU,启动时间,电量等信息   by:授客 QQ:1033553122 1.  查看内存信息 1)查看所有内存信息 命令: dumpsys mem ...

  9. adb shell 命令详解,android, adb logcat

    http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...

随机推荐

  1. 求问ps如何导出单个切片及PS导出所有的切片图像

    在ps里面对图片进行切片,并根据需要弄好切片,利用shift键,可以选择其中部分的切片: 弄好以后,点击“文件”,选择“存储为WEB和设备所用格式”:. 在打开的“存储为WEB和设备所用格式”界面上点 ...

  2. jquery验证规则

    <!DOCTYPE html><html><head><meta charset="utf-8"><title>菜鸟教程 ...

  3. Druid连接池(一)

    介绍 Druid首先是一个数据库连接池,但它不仅仅是一个数据库连接池,它还包含一个ProxyDriver,一系列内置的JDBC组件库,一个SQL Parser. 支持的数据库 Druid支持所有JDB ...

  4. oracle 存储过程分页

    将分页的存储过程封装到包中,包规范 create or replace package pkg_query as type cur_query is ref cursor; PROCEDURE prc ...

  5. 半夜两点灵光一现想出来的一个demo

    功能: 1.用户通过页面下载Excel模板,按照模板填写数据,上传Excel , 服务器解析 ,绘制成折线图.柱状图.雷达图 ....... 2.用户在线编辑数据,绘图 (没想好咋弄) 可定制需求,根 ...

  6. org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password:

    tationProcessor' to allow for resolving potential circular referencesDEBUG 2018-05-28 11:32:35,016 o ...

  7. 9 个用于移动APP开发的顶级 JavaScript 框架【申明:来源于网络】

    9 个用于移动APP开发的顶级 JavaScript 框架[申明:来源于网络] 地址:http://www.codeceo.com/article/9-app-javascript-framework ...

  8. (二)juc线程高级特性——CountDownLatch / Callable / Lock

    5. CountDownLatch 闭锁 Java 5.0 在 java.util.concurrent 包中提供了多种并发容器类来改进同步容器的性能. CountDownLatch 一个同步辅助类, ...

  9. 外星人入侵——安装Pygame

    本文以win10和Python3为例来介绍如何安装Pygame. 安装Pygame需要使用pip,我们首先检查pip是否已被安装. 打开一个终端窗口,并执行如下命令 C:\Users\hys>p ...

  10. 接口测试工具-Jmeter使用笔记(七:用户定义的变量)

    使用场景:一组API根据业务流程制作成测试脚本,想要移植到其他测试环境时,由于数据库发生了变更,有些初始化数据也相应发生了变化,例如环境地址.请求路径等等.博主甚至把服务器地址和接口的部分共同请求路径 ...