Looking at the source code for dumpsys and service, you can get the list of services available by executing the following:
adb shell service -l
You can then supply the service name you are interested in to dumpsys to get the specific information. For example (note that not all services provide dump info):
adb shell dumpsys activity
adb shell dumpsys cpuinfo
adb shell dumpsys battery
As you can see in the code (and in K_Anas's answer), if you call dumpsys without any service name, it will dump the info on all services in one big dump:
adb shell dumpsys
Some services can receive additional arguments on what to show which normally is explained if you supplied a -h
argument, for example:
adb shell dumpsys activity -h
adb shell dumpsys window -h
adb shell dumpsys meminfo -h
adb shell dumpsys package -h
adb shell dumpsys batteryinfo -h
According to official Android information about dumpsys:
The dumpsys tool runs on the device and provides information about the status of system services.
To get a list of available services use
adb shell dumpsys -l
i use dumpsys to catch if app is crashed and process is still active. situation i used it is to find about remote machine app is crashed or not.
dumpsys | grep myapp | grep "Application Error"
or
adb shell dumpsys | grep myapp | grep Error
or anything that helps...etc
if app is not running you will get nothing as result. When app is stoped messsage is shown on screen by android, process is still active and if you check via "ps" command or anything else, you will see process state is not showing any error or crash meaning. But when you click button to close message, app process will cleaned from process list. so catching crash state without any code in application is hard to find. but dumpsys helps you.
Source: Stackoverflow.com