Running monkeyrunner without a phone connected to a PC

I want to run python stability test case with monkeyrunner

however, I want to run the script without connecting the mobile phone to the PC (because battery life is measured)

I usually use "monkeyrunner mytest.py"

So the idea would be to execute a py script with monkeyrunner inside the phone. Is it possible?

+5
source share
3 answers

You can use two approaches:

  • To use the monkey command locally on an Android device and write your own script (the syntax for this command is different from the monkeyrunner syntax)
  • You can use the approach suggested by @Gabriel Porumb. But you should use the command as follows:

First you must run the command:

adb tcpip <port> 

Then on your device you should check which IP address is assigned to your device (you can check this in the settings).

After that you need to execute the command:

 adb connect <your_ip>:<port> 

And now you can run your monkeyrunner script.

+2
source

The monkeyrunner script player only works on PC. However, if you do not want to connect your phone to a PC via a cable, you can try to connect via Wi-Fi. Using:

 adb connect 192.168.xx 

Or something similar to connect to the phone.

0
source

@Yury method 1: locally running the monkey command does not work without root or system signature. To run the monkey command locally, the application must receive permission "android.permission.SET_ACTIVITY_WATCHER", for which the security level is "signature".

0
source

Source: https://habr.com/ru/post/1442954/


All Articles