androidandroid-layoutstress-testingmonkeyrunnermonkey

Inspect time delay for the app to launch in Monkey tool


I'm trying to find out the time-lapsed for the app to launch using the Moneky tool for a specific package. I'm not familiar with what kind of command line could give the time delay the app takes to launch. What if I want to run the same command multiple times to check the difference in time when the app is at hot startup and then when the app at cold startup. Here is the link I looked for here.. I run the default command line but didn't understand the meaning of elapsed time=5584ms.

adb shell monkey -p com.facebook.katana -v 1000> secondTest.txt

Here are some the outputs of the secondTest.txt:

 Events injected: 1000
 :Sending rotation degree=0, persist=false
 :Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
  ## Network stats: elapsed time=5584ms (0ms mobile, 0ms wifi, 5584ms not connected)
 // Monkey finished

Solution

  • You are using monkey to inject 1000 random events, so the elapsed time reported is the time needed to process those events. You could inject only 1 and see how long it takes, however there's a better way, check the logcat for a line like

    ActivityManager: Displayed com.facebook.katana/.StartupTiming: +2s325ms 
    

    This value represents the amount of time elapsed between launching the process and finishing drawing the corresponding activity on the screen.