Android Combat 16: Getprop and Dumpsys commands

Source: Internet
Author: User
Tags get ip

After the Android device is connected to the PC, we can do most of the work with the ADB command. Here are some information about the system with Getprop, Dumpsys.

First, Getprop

The simple principle of this command is to read information from various configuration files in the system. Then these files are easy to find after you enter the device inside the ADB shell:

init.rcdefault.prop/system/build.prop

This information can also be displayed by using the Cat command directly.
More commonly used information is listed below
1. Get IP

$ adb shell getprop dhcp.wlan0.ipaddress192.168.0.107

2. Phone Name

$ adb shell getprop ro.product.deviceUlike2$ adb shell getprop ro.product.modelU705T$ adb shell getprop ro.product.nameoppo17_12035

3.serial number

$ adb shell getprop ro.serialno0000012035ABCXXX

4. Screen density

$ adb shell getprop ro.sf.lcd_density240

Well, just use the ADB shell Getprop to print out all the information. You can use the SetProp command to make the corresponding settings.

Second, Dumpsys

When the Android system starts up with a large number of services, we can use the Dumpsys command to see how each service is running. As an Android developer, we should at least understand the presence of these service:

Currently running services:dmagent nvramagent Surfaceflinger accessibility account activity alarm Appwidget Audi o audioprofile Backup battery batteryinfo bluetooth BLUETOOTH_A2DP bluetooth_profile_manager bluetooth_socket CLI Pboard connectivity Content Country_detector cpuinfo device_policy devicestoragemonitor diskstats DRM. DrmmanagerDropbox entropy Gfxinfo hardware Input_method iphonesubinfo isms location Media. Audio_flinger Media. Audio_policy Media. CameraMedia. MDP_service Media. PlayerMeminfo Memory. DumperMount Mtk-agps mtk-epo-client netpolicy netstats network_management notification Oppo. com. IrutilsPackage permission Phone Power Samplingprofiler search Sensorservice Simphonebook statusbar telephony. RegistryTelephony. Registry2 textservices throttle Uimode usagestats usb Vibrator wallpaper wifi wifip2p window

When we need to know the resolution of the device, we can use the following command:

windowwindow displays)Display: mDisplayId=0init=720320dpi cur=720x1280 app=720x1280 rng=720x670-1280x1230layoutNeeded=false

Or

$ adb shell dumpsys window...Display: init=540x960 base=540x960 cur=540x960 app=540x888 raw=540x960

Refer to:
http://blog.csdn.net/wangjia55/article/details/7446772
http://blog.csdn.net/kevinx_xu/article/details/11846289
http://blog.csdn.net/z_guijin/article/details/8203028

Android Combat 16: Getprop and Dumpsys commands

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.