ADB acquires Android performance data

Source: Internet
Author: User

Environment: Android test environment

Build an Android test environment:

1, download androidsdk;

2, configuration environment variables;

(1), Android_home

(2), Android_home-tools

(3), Android_home-paltform-tools

3, Android Java development, such as the need to run the Android Remote Debugging Bridge (ADB), the need for Java operating environment;

4. Download Java;ps: Download jdk and JRE, JDK is Java development environment, JRE is Java running Environment, development environment includes running environment;

5, the configuration environment variable java_home;

6, verify the java-version; The version number can be

Ps:android mobile phone, such as connecting with Windows computer to install mobile phone driver; Mac automatic monitoring installation

Mobile Performance Test metrics:

1, start time, (1), Cold start (2), hot start

Cold start: The first time the application is started, this time the application process is not created

Hot start: Apply non-first boot, if press back key, do not kill the application process, hot start without initialization process

ADB command:adb shell am start-w mainactivity can see Thistime totaltime WaitTime

Thistime indicates that the start of the last activity of a series of start-up activity is time consuming;

TotalTime indicates the time-consuming startup of the new application, including the start of the new process and the start of the activity, but does not include the time of the previous application activity pause;

Waittime is the total time consuming, including the previous application activity pause and the time when the new app started;

Finally, if you only care about the start-up time of an application, refer to TotalTime, if you are concerned about the time-consuming system startup application, refer to waittime; If you are concerned about application interface activity start time, refer to Thistime

Ps:am Full name Activity Manager, you can use AM to simulate the behavior of heavier systems

PM Full Name Package Manager, you can use PM command to simulate Android behavior or query device applications, etc., when you execute PM command under the ADB shell command

2, CPU occupancy rate;

adb command: adb shell top | grep pid

ADB Shell Top | grep Package

adb Shell Dumpsys Cpuinfo | grep pid

adb Shell Dumpsys Cpuinfo | grep Package

PS: It is best to first enter the ADB shell into the Android system, after executing the ADB shell statement in the Windows System DOS window, grep replaced by find

3, memory occupancy rate;

adb command: adb shell Dumpsys meminfo | grep pid

adb Shell Dumpsys Meminfo | grep Package

PS: It is best to first adb shell into the Android system after executing ADB shell statement. Windows System DOS window grep replaced by find

Total rows of data as measured data used in the current app beta;

Execution results will see USS, RSS, VSS, PSS

The USS refers to a process that takes up physical memory (without the memory occupied by the shared library);

RSS refers to the actual physical memory used (contains the memory occupied by the shared library);

VSS refers to virtual good memory;

PSS refers to the actual physical memory used;

PS: The mobile side uses PSS indicator

4, power consumption;

adb command: adb shell Dumpsys battery

PS: It is best to first adb shell into the Android system, after executing the ADB shell statement

An interpretation of the message appears:

AC Powered:false whether to connect the AC (power) Charging cable

USB Powered:true whether to connect USB (PC or laptop USB jack) to charge

Wireless Powered:false Whether a radio source is used

Status: 1 battery status, 2 charging status, other non-charging status

level:58 Charge (%)

Scale: 100. Maximum battery value

Voltage: 3977 Current voltage (MV)

Current now:-335232. Current current (MA)

temperature:355 battery temperature, unit 0.1 degrees Celsius

Technology:li-poly. Battery type

5, temperature;

Cat/etc/thermald.conf

Cat for view command

6. Frames per second (smoothness) [FPS];

adb command: ADB shell Dumpsys gfxinfo Package

PS: It is best to first adb shell into the Android system, after executing the ADB shell statement

Under normal circumstances the frame rate should be around 16ms, if 1 seconds 60 frames, and the execute time is too long! Need to optimize

7, GPU occupancy rate;

PS: The game will be tested, but generally not to test the indicator;

8, the network;

(1), wi-fi[network-friendly degree]

(2), honeycomb [resource-consuming and friendly]

adb command: ADB shell Dumpsys Package | grep userid [use the app package name to get the app's UserID (unique and fixed after installation)]

adb shell CAT/PROC/UID_STAT/USERID/TCP_RCV [cat for View command, read TCP_RCV get download app traffic information (after device restart 0)]

adb shell cat/proc/uid_stat/userid/tcp_snd [cat for View command, read tcp_snd get download app traffic information (after device restart 0)]

9, ANR (page no response);

10, Crash (program crashes);

Ps:anr and crash use the monkey test

Note: Dumpsys is an executable file inside the Android phone

ADB acquires Android performance data

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.