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.
source share