15

I want to use android's monkey for stress test my app but monkey opens status bar and changes settings on my phone.

To start monkey I use:

 adb -s S5660a19e722f shell monkey -p com.lmmx.app -v -v -v 10000 --throttle 500

I thought that -p com.lmmx.app parameter must prevent this... I use 2.3.5 and 2.3.6 phones for testing.

Any suggestions would be appreciated.

lordmegamax
  • 2,684
  • 2
  • 26
  • 29

3 Answers3

20

I have a 5.0(lollipop) phone and was able to do this with screen pinning

  1. activate it with settings>security>screen pinning
  2. press the app switcher/multitasking button next to your home button
  3. on the bottom corner of each app in the recents apps list will be a pin icon

From there you can run monkey on your device without it changing.

einverne
  • 6,454
  • 6
  • 45
  • 91
user3044482
  • 401
  • 4
  • 11
3

I just created an app that will mask the status bar for the exact same purpose.

It just adds a system overlay over the status bar, preventing anyone from accessing the status bar.

You can check it out here : github sources

It works great for our monkey tests, especially on launcher apps.

Feel free to use it. If you want to directly download an apk you can find it here

ArnaudR
  • 1,954
  • 18
  • 19
2

You can hide status bar in code use isUserAMonkey ()

if(ActivityManager.isUserAMonkey()){
//your code
}

Setup Monkey to ignore or prevent status bar is impossible because you can't limit some area on screen or disable some function in Monkey keys.

Andy
  • 49,085
  • 60
  • 166
  • 233
RebOOter
  • 21
  • 2