Android Performance Optimization Five performance analysis tools Dumpsys use

Source: Internet
Author: User


Android provides the Dumpsys tool can be used to view the system service information and status of interest, the phone connected to the computer can be directly executed by the command line adb shell Dumpsys View all supported services but this output too much, can be through the Dumpsys | grep "DUMP of Service" shows only the information of the primary SERVICE

I. List all support commands for Dumpsys

> adb shell$ Dumpsys | grep "DUMP of SERVICE"

The following is the output information on my personal Samsung S3 phone
C:\WINDOWS\SYSTEM32>ADB shell[email protected]:/$ Dumpsys | grep "DUMP of SERVICE" Dumpsys | grep "Dump of service" dump of service atcmdfwd:dump of service customfrequencymanagerservice:dump of service Direncryptser Vice:dump of service Exynos.HWCService:DUMP of service Exynos.IPService:DUMP of service fmplayer:dump of service Ledservic E:dump of service Sectvoutservice:dump of service surfaceflinger:dump of service tvoutservice_c:dump of service Accessibil Ity:dump of service Account:dump of service activity:dump of service alarm:dump of service Android.security.keystore:DUMP of service Application_policy:dump of service appops:dump of service appwidget:dump of service audio:dump of service Backu P:dump of service Battery:dump of service batteryinfo:dump of service bluetooth_manager:dump of service Bluetooth_secure_m Ode_manager:dump of service Clipboard:dump of service clipboardex:dump of service commontime_management:dump of Service Co Nnectivity:dump of SERVICE Container_service:DUMP of service Content:dump of service country_detector:dump of service cpuinfo:dump of service dbinfo:dump of service de Vice_policy:dump of service Devicestoragemonitor:dump of service diskstats:dump of service Display:dump of service dreams: DUMP of service Drm.drmManager:DUMP of service dropbox:dump of service edmnativehelper:dump of service Enterprise_license_ Policy:dump of service Enterprise_policy:dump of service entropy:dump of service gfxinfo:dump of service Hardware:dump of Service Harmony_eas_service:dump of service input:dump of service input_method:dump of service Iphonesubinfo:dump of SERVI CE Isms:dump of service license_log_service:dump of service location:dump of service lock_settings:dump of service Log_man Ager_service:dump of service Mdm.remotedesktop:DUMP of service Media.audio_flinger:DUMP of service Media.audio_policy:d UMP of service Media.camera:DUMP of service Media.player:DUMP of service meminfo:dump of service Motion_recognition:dump O F SERVICE Mount:dump of SERVICE Multiwindow:dump of service netpolicy:dump of service netstats:dump of service network_management:dump of service NFC :D UMP of service nfccontroller:dump of service notification:dump of service package:dump of service Permission:dump of SER VICE Phone:dump of service phone_restriction_policy:dump of service phoneext:dump of service power:dump of service Remotei Njection:dump of service Samplingprofiler:dump of service Samsung.smartfaceservice:DUMP of service Scheduling_policy:d UMP of service Search:dump of service sec_analytics:dump of service secontroller:dump of service Sensorservice:dump of SER VICE Serial:dump of service servicediscovery:dump of service simphonebook:dump of service sip:dump of service Statusbar:du MP of service Telephony.registry:DUMP of service textservices:dump of service tvoutservice:dump of service Uimode:dump of Service Updatelock:dump of service usagestats:dump of service usb:dump of service user:dump of service Vibrator:dump of SE Rvice Voip:dump of SERVICE WAllpaper:dump of service Wfd:dump of service wifi:dump of service wifi_policy:dump of service wifip2p:dump of service Wind ow

Ii. specific commands How to view help from the above you can see that the service is very many, the "DUMP of SERVICE" keyword after the word can be directly through the Dumpsys + words to see the relevant information, each how to use a common way to view Help.
To see the use of each command, the following example shows Meminfo:
[Email protected]:/$ dumpsys meminfo-hdumpsys meminfo-hmeminfo dump options: [-A] [--oom] [process]  -a:include all Available information for each process.  --oom:only Show processes organized by OOM Adj. If [process] is specified it can be the name orpid of a specific process to dump.

Iii. explanation of some key commands
Name Function
Account Show accounts information
Activity Show All activities information
Cpuinfo displaying CPU information
Window Show the keyboard, window, and their relationship
Wifi Show WiFi information
Batteryinfo $package _name Battery power information and CPU usage duration
Package PackageName Get installation package Information
Usagestats The time each interface starts
StatusBar Displays information about the status bar
Meminfo Memory information (meminfo $package _name or $pid use the program's package name or process ID to display memory information)
Diskstats Disk-related information
Battery Battery information
Alarm Show Alarm Information

Activity-use ADB shell Dumpsys to detect Android's Activity Task Stack window-get the current app's component via the ADB Shell Dumpsys command
StatusBar-Find out which app your ad notifications belong to Dumpsys StatusBar | grep notification=notification



Iv. Reference Dumpsys (Official document)
How to discover memory usage of my application in Android
Introduction and use of Dumpsys functions in Android (Code analysis)



for more optimization related articles, see:Android Basic Learning Article Summary"Part III performance optimization



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.