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

Huawei AppGallery Paid Promotion Audience Targeting Function Operation Guide

Huawei AppGallery Paid Promotion Audience Targeti...

What should I do if Juleliang Qianchuan fails the review?

What should I do if Juleliang Qianchuan fails the...

What is the use of adding sugar when frying chestnuts?

Purple rotten pear and red wrinkled jujube, but t...

Advertising strategies for the four hot-selling industries during Double Eleven!

Double Eleven is approaching. In the e-commerce b...

Three growth models and implementation principles of Internet finance!

1. What do we mean when we talk about user behavi...

Douban Competitive Product Analysis

As a gathering place for literary and artistic yo...

What exactly is the cholera that broke out at Wuhan University?

Mixed Knowledge Specially designed to cure confus...

The core strategy for high click-through rate in live broadcast rooms!

Why do we need to conduct research on high clicks...

Silicon Valley Growth Hacker Practical Manual!

This article is from the Silicon Valley Growth Ha...