Start Time Test

The main flow when the app starts

  • application OnCreate
    load third party sdk
  • activity OnCreate
    loading own logic
    transmits a data request xxx.json remote
    rendering interface List

Response time

Italic style

  • app start: first install start, cold start, warm start, hot start, the first screen to start
    the first installation start : a app first start time is relatively long, because the process will be more time-consuming first start initialization, patch download , cache data, there are a lot of data has not been cached or preheating, the system loads the remote server through some resources into local, the next time you start again, good local content has been loaded earlier, such as advertising, user data , then you do not have to be read remotely, then will speed up the startup speed, so the first time you start slow, this is slow, Google has a standard.
    Cold start : start with the first installation is almost, but not the first installation, is when the process does not exist, create called cold-start from the beginning of the process. (Cold start usually no more than 5s)
    Warm start : There are some resources already exist, there is a process, activity is destroyed, then called warm start start (no more than 2s)
    Hot start : most of the resources are, just switch on the interface, background cut foreground, user processes, and data are not lost, this is the start called hot start. (Not more than 1.5s)
    first screen to start : the first screen to load a complete
    cold start time is more important, this type of test are generally

Test Methods

Performance data logcat in
realization installation package names package = com.snda.wifilocating
measured data before the first start, first clean the cache data with the command: adb shell pm clear $ package

Encountered a Security exception: PID 28341 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package com.snda.wifilocating error
Here Insert Picture Description
solution: open developer options: USB debugging (security settings), OEM unlock

Here Insert Picture Description
Kill the process: adb shell am force-stop $ package
start app: adb shell am start -S -W $ package / .com.lantern.launcher.ui.MainActivity
Here Insert Picture Description
This means the first activity to complete load out
thistime
totalTime
waittime

Released four original articles · won praise 2 · Views 207

Guess you like

Origin blog.csdn.net/qq_22753843/article/details/104288290