Common commands of the Android system tool dumpsys, effectively obtain device information and discover application crash problems

Common commands of the Android system tool dumpsys, effectively obtain device information and discover application crash problems

dumpsys

"dumpsys is an executable file in the Android system", which is mainly used to output (dump) some information of the current Android system (such as Activity, package, etc.). It is very effective for analyzing Android device problems, checking running status, usage, etc.

The method of using the dumpsys command is to enter the shell environment of the device through adb shell and execute the dumpsys command. For example, executing adb shell dumpsys -l can view all the services running in the current Android system. In order to view the information of a service more specifically, you can specify the service name, such as adb shell dumpsys activity to view the information related to Activity.

In the Android system, because each service implements the dump method, when the dumpsys command is executed, the system will obtain the corresponding service information through the ServiceManager and execute the dump function of the service to obtain and output relevant information.

Common dumpsys commands

  1. 「dumpsys activity」 //Query AMS service related information, equivalent to ActivityManagerService.dump()
  • dumpsys activity intents: query the system for all pending intent information;
  • dumpsys activity broadcasts: can query all registered broadcast receivers, foreground broadcasts, and background broadcast information;
  • dumpsys activity providers: query system component provider related information;
  • dumpsys activity activities: query the system component activity related information;
  • dumpsys activity services: query system component service related information;
  1. 「dumpsys window」 //Query WMS service related information
  • dumpsys window: can get the application of the current interface, and can see the window and application that have gained focus;
  1. 「dumpsys cpuinfo」 //Query CPU status - dumpsys cpuinfo: Get the current CPU usage, or use the top command;
  2. 「dumpsys meminfo」 //Query memory status
  • dumpsys meminfo + package name: view application memory usage information;
  • dumpsys meminfo --oom: View the application memory level;
  1. 「dumpsys package」 //Query PMS related information
  • dumpsys package + package name: view application related information;
  • dumpsys package + package name | grep version: view the version information of the application;
  • dumpsys package + package name | grep apk: view application installation path information;
  1. 「dumpsys gfxinfo」 //Query image related information
  • dumpsys gfxinfo+ package name: check the frame loss of the application;

<<:  iOS 18 is about to be released, get to know the new features first

>>:  The key to adjusting the Android window soft keyboard: windowSoftInputMode property setting

Recommend

Overseas server rental, overseas server rental

Renting a server overseas means renting a server ...

Are strawberries the dirtiest fruit?

From November to February of the following year, ...

How to deploy huge amounts of Qianchuan?

Bytedance Qianchuan is an e-commerce advertising ...

Four months after entering China, has Apple Pay experienced its embarrassment?

In February of this year, I suddenly found that a...

4 Effective Strategies to Increase App User Engagement

For an accounting app, an effective participating...

Aircraft piston engine

Aviation piston engines rely on the reciprocating...