Window manager (window) commands: help Print this help text. size [reset|WxH|WdpxHdp] Return or override display size. width and height in pixels unless suffixed with 'dp'. density [reset|DENSITY] Return or override display density. overscan [reset|LEFT,TOP,RIGHT,BOTTOM] Set overscan area for display. scaling [off|auto] Set display scaling mode. dismiss-keyguard
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 <TARGET-PACKAGE> 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 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
1|shell@JDtab:/ $
4.4.1 list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
list packages [options] filter 输出所有软件包,或者,仅输出包名称包含 filter 中的文本的软件包。 选项:
-f:查看它们的关联文件。 -d:进行过滤以仅显示已停用的软件包。 -e:进行过滤以仅显示已启用的软件包。 -s:进行过滤以仅显示系统软件包。 -3:进行过滤以仅显示第三方软件包。 -i:查看软件包的安装程序。 -u:也包括卸载的软件包。 --user user_id:要查询的用户空间。 例: adb shell pm list packages adb shell pm list packages -s 系统app adb shell pm list packages -3 第三方app
Which processes to show (selections may be comma separated lists):
-A All processes -a Processes with terminals that aren't session leaders -d All processes that aren't session leaders -e Same as -A -g Belonging to GROUPs -G Belonging to real GROUPs (before sgid) -p PIDs (--pid) -P Parent PIDs (--ppid) -s In session IDs -t Attached to selected TTYs -T Show threads -u Owned by USERs -U Owned by real USERs (before suid)
选项说明 -t timeout 指定时间 默认10秒 --help 查看帮助 -l 列出可用参数列表 --skip services Specifies the services that you do not want to include in the output. service [arguments] Specifies the service that you want to output. Some services may allow you to pass optional arguments. You can learn about these optional arguments by passing the -h option with the service, as shown below: adb shell dumpsys procstats -h
-c When specifying certain services, append this option to output data in a machine-friendly format. -h For certain services, append this option to see help text and additional options for that service.
查看帮助 adb shell dumpsys activity -h Activity manager dump options: [-a] [-c] [-p PACKAGE] [-h] [WHAT] ... WHAT may be one of: a[ctivities]: activity stack state //查看activity r[recents]: recent activities state b[roadcasts] [PACKAGE_NAME] [history [-s]]: broadcast state broadcast-stats [PACKAGE_NAME]: aggregated broadcast statistics i[ntents] [PACKAGE_NAME]: pending intent state p[rocesses] [PACKAGE_NAME]: process state o[om]: out of memory management perm[issions]: URI permission grant state prov[iders] [COMP_SPEC ...]: content provider state provider [COMP_SPEC]: provider client-side state s[ervices] [COMP_SPEC ...]: service state //服务 as[sociations]: tracked app associations settings: currently applied config settings service [COMP_SPEC]: service client-side state package [PACKAGE_NAME]: all state related to given package all: dump all activities top: dump the top activity WHAT may also be a COMP_SPEC to dump activities. COMP_SPEC may be a component name (com.foo/.myApp), a partial substring in a component name, a hex object identifier. -a: include all available server state. -c: include client state. -p: limit output to given package. --checkin: output checkin format, resetting data. --C: output checkin format, not resetting data. --proto: output dump in protocol buffer format. --autofill: dump just the autofill-related state of an activity
1 2 3 4 5
例: 查看acitivty信息 adb shell dumpsys activity activities 或者 adb shell dumpsys activity a 查看微信所有服务 adb shell dumpsys activity s com.tencent.mm