adb shell pm命令大全

2016-07-13 16:28 暂无评论
  1. >adb shell pm  
  2.   
  3. usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FIL  
  4. TER]  
  5.        pm list permission-groups  
  6.        pm list permissions [-g] [-f] [-d] [-u] [GROUP]  
  7.        pm list instrumentation [-f] [TARGET-PACKAGE]  
  8.        pm list features  
  9.        pm list libraries  
  10.        pm list users  
  11.        pm path PACKAGE  
  12.        pm dump PACKAGE  
  13.        pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f]  
  14.                   [--algo <algorithm name> --key <key-in-hex> --iv <IV-in-hex>]  
  15.                   [--originating-uri <URI>] [--referrer <URI>] PATH  
  16.        pm uninstall [-k] PACKAGE  
  17.        pm clear [--user USER_ID] PACKAGE  
  18.        pm enable [--user USER_ID] PACKAGE_OR_COMPONENT  
  19.        pm disable [--user USER_ID] PACKAGE_OR_COMPONENT  
  20.        pm disable-user [--user USER_ID] PACKAGE_OR_COMPONENT  
  21.        pm disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENT  
  22.        pm block [--user USER_ID] PACKAGE_OR_COMPONENT  
  23.        pm unblock [--user USER_ID] PACKAGE_OR_COMPONENT  
  24.        pm grant PACKAGE PERMISSION  
  25.        pm revoke PACKAGE PERMISSION  
  26.        pm set-install-location [0/auto] [1/internal] [2/external]  
  27.        pm get-install-location  
  28.        pm set-permission-enforced PERMISSION [true|false]  
  29.        pm trim-caches DESIRED_FREE_SPACE  
  30.        pm create-user USER_NAME  
  31.        pm remove-user USER_ID  
  32.        pm get-max-users  
  33.   
  34. pm list packages: prints all packages, optionally only  
  35.   those whose package name contains the text in FILTER.  Options:  
  36.     -f: see their associated file.  
  37.     -d: filter to only show disbled packages.  
  38.     -e: filter to only show enabled packages.  
  39.     -s: filter to only show system packages.  
  40.     -3: filter to only show third party packages.  
  41.     -i: see the installer for the packages.  
  42.     -u: also include uninstalled packages.  
  43.   
  44. pm list permission-groups: prints all known permission groups.  
  45.   
  46. pm list permissions: prints all known permissions, optionally only  
  47.   those in GROUP.  Options:  
  48.     -g: organize by group.  
  49.     -f: print all information.  
  50.     -s: short summary.  
  51.     -d: only list dangerous permissions.  
  52.     -u: list only the permissions users will see.  
  53.   
  54. pm list instrumentation: use to list all test packages; optionally  
  55.   supply <TARGET-PACKAGE> to list the test packages for a particular  
  56.   application.  Options:  
  57.     -f: list the .apk file for the test package.  
  58.   
  59. pm list features: prints all features of the system.  
  60.   
  61. pm list users: prints all users on the system.  
  62.   
  63. pm path: print the path to the .apk of the given PACKAGE.  
  64.   
  65. pm dump: print system state associated w ith the given PACKAGE.  
  66.   
  67. pm install: installs a package to the system.  Options:  
  68.     -l: install the package with FORWARD_LOCK.  
  69.     -r: reinstall an exisiting app, keeping its data.  
  70.     -t: allow test .apks to be installed.  
  71.     -i: specify the installer package name.  
  72.     -s: install package on sdcard.  
  73.     -f: install package on internal flash.  
  74.     -d: allow version code downgrade.  
  75.   
  76. pm uninstall: removes a package from the system. Options:  
  77.     -k: keep the data and cache directories around after package removal.  
  78.   
  79. pm clear: deletes all data associated with a package.  
  80.   
  81. pm enable, disable, disable-user, disable-until-used: these commands  
  82.   change the enabled state of a given package or component (written  
  83.   as "package/class").  
  84.   
  85. pm grant, revoke: these commands either grant or revoke permissions  
  86.   to applications.  Only optional permissions the application has  
  87.   declared can be granted or revoked.  
  88.   
  89. pm get-install-location: returns the current install location.  
  90.     0 [auto]: Let system decide the best location  
  91.     1 [internal]: Install on internal device storage  
  92.     2 [external]: Install on external media  
  93.   
  94. pm set-install-location: changes the default install location.  
  95.   NOTE: this is only intended for debugging; using this can cause  
  96.   applications to break and other undersireable behavior.  
  97.     0 [auto]: Let system decide the best location  
  98.     1 [internal]: Install on internal device storage  
  99.     2 [external]: Install on external media  
  100.   
  101. pm trim-caches: trim cache files to reach the given free space.  
  102.   
  103. pm create-user: create a new user with the given USER_NAME,  
  104.   printing the new user identifier of the user.  
  105.   
  106. pm remove-user: remove the user with the given USER_IDENTIFIER,  
  107.   deleting all data associated with that user  
  1. list packages [options] filter输出所有软件包,或者,仅输出包名称包含 filter 中的文本的软件包。
    选项:
    • -f:查看它们的关联文件。
    • -d:进行过滤以仅显示已停用的软件包。
    • -e:进行过滤以仅显示已启用的软件包。
    • -s:进行过滤以仅显示系统软件包。
    • -3:进行过滤以仅显示第三方软件包。
    • -i:查看软件包的安装程序。
    • -u:也包括卸载的软件包。
    • --user user_id:要查询的用户空间。
  2. list permission-groups输出所有已知的权限组。
  3. list permissions [options] group输出所有已知权限,或者,仅输出 group 中的权限。
    选项:
    • -g:按组加以组织。
    • -f:输出所有信息。
    • -s:简短摘要。
    • -d:仅列出危险权限。
    • -u:仅列出用户将看到的权限。
  4. list instrumentation [options]列出所有测试软件包。
    选项:
    • -f:列出用于测试软件包的 APK 文件。
    • target_package:列出仅用于此应用的测试软件包。
  5. list features输出系统的所有功能。
  6. list libraries输出当前设备支持的所有库。
  7. list users输出系统上的所有用户。
  8. path package输出给定 package 的 APK 的路径。
  9. install [options] path将软件包(通过 path 指定)安装到系统。
    选项:
    • -l:安装具有转发锁定功能的软件包。
    • -r:重新安装现有应用,保留其数据。
    • -t:允许安装测试 APK。
    • -i installer_package_name:指定安装程序软件包名称。
    • -s:在共享的大容量存储(如 sdcard)上安装软件包。
    • -f:在内部系统内存上安装软件包。
    • -d:允许版本代码降级。
    • g:授予应用清单文件中列出的所有权限。
  10. uninstall [options] package从系统中移除软件包。
    选项:
    • -k:移除软件包后保留数据和缓存目录。
  11. clear package删除与软件包关联的所有数据。
  12. enable package_or_component启用给定软件包或组件(作为“package/class”写入)。
  13. disable package_or_component停用给定软件包或组件(作为“package/class”写入)。
  14. disable-user [options] package_or_component
    选项:
    • --user user_id:要停用的用户。
  15. grant package_name permission向应用授予权限。在运行 Android 6.0(API 级别 23)及更高版本的设备上,可以是应用清单中声明的任何权限。在运行 Android 5.1(API 级别 22)和更低版本的设备上,必须是应用定义的可选权限。
  16. revoke package_name permission从应用中撤销权限。在运行 Android 6.0(API 级别 23)及更高版本的设备上,可以是应用清单中声明的任何权限。在运行 Android 5.1(API 级别 22)和更低版本的设备上,必须是应用定义的可选权限。
  17. set-install-location location更改默认安装位置(注:此命令仅用于调试目的;使用此命令会导致应用中断和其他意外行为。)。位置值:
    • 0:自动—让系统决定最佳位置。
    • 1:内部—安装在内部设备存储上。
    • 2:外部—安装在外部介质上。
  18. get-install-location返回当前安装位置。返回值:
    • 0 [auto]:让系统决定最佳位置。
    • 1 [internal]:安装在内部设备存储上
    • 2 [external]:安装在外部介质上
  19. set-permission-enforced permission [true|false]指定是否应强制执行给定的权限。
  20. trim-caches desired_free_space减少缓存文件以达到给定的可用空间。
  21. create-user user_name使用给定的 user_name 创建新用户,输出新用户的标识符。
  22. remove-user user_id移除具有给定的 user_id 的用户,删除与该用户关联的所有数据。
  23. get-max-users输出设备支持的最大用户数。

当前文章价值5.76元,扫一扫支付后添加微信提供帮助!(如不能解决您的问题,可以申请退款)

你可能感兴趣的文章

来源:每日教程每日一例,深入学习实用技术教程,关注公众号TeachCourse
转载请注明出处: https://www.teachcourse.cn/07131624-adb-shell-pm ,谢谢支持!

资源分享

Android获取apk安装包的版本及包名等信息 Android获取apk安装包的版本及包
浅谈ViewHolder的优化getView方法 浅谈ViewHolder的优化getView
成员变量的隐藏和方法的重写 成员变量的隐藏和方法的重写
静态代码块,非静态代码块和构造方法执行顺序 静态代码块,非静态代码块和构造

发表评论

呲牙 憨笑 坏笑 偷笑 色 微笑 抓狂 睡觉 酷 流汗 鼓掌 大哭 可怜 疑问 晕 惊讶 得意 尴尬 发怒 奋斗 衰 骷髅 啤酒 吃饭 礼物 强 弱 握手 OK NO 勾引 拳头 差劲 爱你

表情