ADB shell Dumpsys, the default is to print out all of the current system service information, usually we do not want to see so much information, you can add a specific service name, such as to obtain information about the device battery, you can use the following command:
>ADB Shell Dumpsys Battery
Current Battery Service State:
AC Powered:false
USB Powered:true
Wireless Powered:false
Max Charging current:0
Status:5
Health:2
Present:true
level:100
scale:100
voltage:4321
temperature:302
Technology:li-ion
To obtain a complete list of system services, you can use the following command:
>ADB Shell Dumpsys-l
Currently running services:
AutoLaunch
Dockobserver
Surfaceflinger
Accessibility
Account
Activity
Alarm
Alipayservice
Android. App6939service
Android.hardware.fingerprint.IFingerprintDaemon
Android.security.keystore
AppOps
Appwidget
Audio
Backup
Battery
...
A few common commands:
adb shell dumpsys display #Get display related information, you can extract resolution information from it
adb shell dumpsys cpuinfo #Get CPU information
adb shell dumpsys meminfo #Get memory information
adb shell dumpsys meminfo PACKAGE_NAME #Get memory information of specific applications
adb shell dumpsys activity #Get activity information
adb shell dumpsys activity top #Get the UI information of the current interface
adb shell dumpsys activity top | findstr ACTIVITY #Get the activity of the current interface
adb shell dumpsys wifi #Get wifi information
adb shell dumpsys power #Get power management information, you can get whether the screen is locked: mWakefulness=Asleep or Awake
Next the main introduction of the next Telephony.registry service, this service is about wireless communication, you can get wireless communication related parameters. The execution command gets the following output:
>ADB Shell Dumpsys Telephony.registry
Last known state:
Phone id=0 #The first card in the dual-card terminal
Mcallstate=0 #0 means standby state, 1 means the call is not answered, 2 means the phone is busy
Mcallincomingnumber=
Mservicestate=0 0 Voice Home data home CMCC CMCC 46000 CMCC CMCC 46000 LTE LTE CSS not supported-1-1 roamind=-1 Defroami Nd=-1 Emergonly=false Isdataroamingfromregistration=false
msignalstrength=signalstrength:99 0-120-160-120-1-1 17-113-15-40 2147483647 2147483647 gsm|lte
Mmessagewaiting=false
Mcallforwarding=false #Whether to enable call forwarding
Mdataactivity=0
MDATACONNECTIONSTATE=2#0: No data connection 1: Creating data connection 2: Connected
mdataconnectionpossible=true# whether there is a data connection
Mdataconnectionreason=dataattached
mdataconnectionapn=
Mdataconnectionlinkproperties=null
Mdataconnectionnetworkcapabilities=null
MCELLLOCATION=BUNDLE[MPARCELLEDDATA.DATASIZE=64]
Mcellinfo=null
Phone id=1
Mcallstate=0
Mcallincomingnumber=
...
In addition to the above comments, the following is the main interpretation of two fields: Mservicestate and Msignalstrength. From the source can be seen directly print out the contents of the class ServiceState and signalstrength:
private SignalStrength mSignalStrength = new SignalStrength();
...
pw.println("last known state:");
...
pw.println(" mServiceState=" + mServiceState);
pw.println(" mSignalStrength=" + mSignalStrength);
...
The content output format of the ServiceState class allows you to view the source code https://github.com/android/platform_frameworks_base/blob/master/telephony/java/ Android/telephony/servicestate.java
(Search for "toString" function):
@Override
public String toString() {
String radioTechnology = rilRadioTechnologyToString(mRilVoiceRadioTechnology);
String dataRadioTechnology = rilRadioTechnologyToString(mRilDataRadioTechnology);
return (mVoiceRegState + " " + mDataRegState
+ " "
+ "voice " + getRoamingLogString(mVoiceRoamingType)
+ " "
+ "data " + getRoamingLogString(mDataRoamingType)
+ " " + mVoiceOperatorAlphaLong
+ " " + mVoiceOperatorAlphaShort
+ " " + mVoiceOperatorNumeric
+ " " + mDataOperatorAlphaLong
+ " " + mDataOperatorAlphaShort
+ " " + mDataOperatorNumeric
+ " " + (mIsManualNetworkSelection ? "(manual)" : "")
+ " " + radioTechnology
+ " " + dataRadioTechnology
+ " " + (mCssIndicator ? "CSS supported" : "CSS not supported")
+ " " + mNetworkId
+ " " + mSystemId
+ " RoamInd=" + mCdmaRoamingIndicator
+ " DefRoamInd=" + mCdmaDefaultRoamingIndicator
+ " EmergOnly=" + mIsEmergencyOnly
+ " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration);
}
As a result, mservicestate=0 0 voice home data home CMCC CMCC 46000 CMCC CMCC 46000 LTE LTE CSS not supported-1-1 roamind=-1 Def Roamind=-1 Emergonly=false Isdataroamingfromregistration=false The meanings of each field are at a glance.
Similarly, the Signalstrength class can also find "toString" source code:
/**
* @return string representation.
*/
@Override
public String toString() {
return ("SignalStrength:"
+ " " + mGsmSignalStrength
+ " " + mGsmBitErrorRate
+ " " + mCdmaDbm
+ " " + mCdmaEcio
+ " " + mEvdoDbm
+ " " + mEvdoEcio
+ " " + mEvdoSnr
+ " " + mLteSignalStrength
+ " " + mLteRsrp
+ " " + mLteRsrq
+ " " + mLteRssnr
+ " " + mLteCqi
+ " " + mTdScdmaRscp
+ " " + (isGsm ? "gsm|lte" : "cdma"));
}
From msignalstrength=signalstrength:99 0-120-160-120-1-1 17-113-15-40 2147483647 2147483647 Gsm|lte, you can see RSRP=-113,RSRQ =-15 and so on.
The use and telephony.registry interpretation of Dumpsys command