FW-Debug:
adb shell service list
//列出当前运行的服务以及对应name
例如:
adb shell service list | findstr IStatusBarService
//过滤服务
206 statusbar: [com.android.internal.statusbar.IStatusBarService]
命令行对应代码调用大体流程
IBinder::shellCommand()/cmd.cpp --> shellCommand()/onShellCommand()/Binder.java… --> onShellCommand()/XXXManagerService.java --> exec()/onCommand()/ShellCommand.java
–>
onCommand()/PackageManagerShellCommand.java
onCommand()/ActivityManagerShellCommand.java
onCommand()/WindowManagerShellCommand.java
…
命令行:
adb shell cmd -l
//列出当前运行的服务(服务对应name)
cmd activity = am
cmd window = wm
cmd package = pm
-h = help
例如:
adb shell cmd activity help
//查询ams的相关命令
adb shell cmd window -h
//查询wms的相关命令
adb shell cmd package -h
//查询pms的相关命令
adb shell cmd statusbar -h
//查询statusbar的相关命令
dumpsys:
adb shell dumpsys -l
//列出当前运行的服务(服务对应name)
adb shell dumpsys statusbar
//获取statusbar服务相关dumpsys信息
adb shell dumpsys activity -h
//查询ams的相关dumpsys 操作
Activity manager dump options:
[-a] [-c] [-p PACKAGE] [-h] [WHAT] …
附1:
adb shell cmd -l
Currently running services:
附2:
adb shell service list
Found 309 services: