Dumpsys command of ADB shell - detailed explanation of android component information

Basic usage command: dumpsys activity -h

Activity manager dump options:[-a][-c][-p package][-h][cmd]...//这个是后面可以跟的参数
  cmd may be one of://这个代表可以跟的命令
    a[ctivities]: activity stack state //activity的栈信息
    r[recents]: recent activities state//最新的acivity的信息
    b[roadcasts][PACKAGE_NAME][history [-s]]: broadcast state//broadcastsde 相关信息
    i[ntents][PACKAGE_NAME]: pending intent state//intent的信息
    p[rocesses][PACKAGE_NAME]: process state//进程相关的信息
    o[om]:out of memory management//内存溢出
    prov[iders][COMP_SPEC ...]: content provider state//provider信息
    provider [COMP_SPEC]: provider client-side state
    s[ervices][COMP_SPEC ...]: service state
    as[sociations]: tracked app associations
    service [COMP_SPEC]: service client-side state
    package[PACKAGE_NAME]: all state related to given package
    all:dump all activities //输出所有的activity信息
    top:dump the top activity//输出当前栈顶的activity信息
    write: write all pending state to storage
    track-associations: enable association tracking
    untrack-associations: disable and clear association tracking
  cmd 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.

Introduction to common command usage

1.dumpsys activity top

Get a new app, we often locate the name of the current focus activoty.
This command can display, and can also display the information of the included fragment',

2.dumpsys activity | grep run

Filter all current activity stack information.

3.dumpsys activity -p 包名

Filter information about a packet.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326119778&siteId=291194637