0

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

1 Answers1

0

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.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • Thank you, I know this method before. I'm trying to make it with the Moneky stress testing tool. I think injecting a random one event might not consider calling the app directly, it might do different events, like checking the volume sound, etc. – Ahmed Mostfa_89 Aug 03 '20 at 18:08
  • From the docs: "Here is a more typical command line, which **will launch your application** and send 500 pseudo-random events to it: `$ adb shell monkey -p your.package.name -v 500`", so sending 1, will launch your app and send the event. – Diego Torres Milano Aug 03 '20 at 20:33