How to use android monkey

6.8k Views Asked by At

I am a little confused on how to actually use monkey, i thought you were supposed to power on your emulator and go into terminal editor and type:

$ adb shell monkey -p insert.my.package.name.here -v 500

since that did not work (error, adb: permission denied)

i tried monkey -p insert.blah.blah -v 500 and this comes up that it has been killed, what am I doing wrong?

2

There are 2 best solutions below

1
On

It's probably trying to talk to a device over your USB port.

You probably just need to add an -e in there to tell adb to connect to the emulator:

$ adb shell monkey -p insert.my.package.name.here -v 500

(Or -s serialnum if you have more than one emulator running.)

See Directing commands in the ADB docs.

0
On

It's well explained here:

https://android.googlesource.com/platform/development/+/master/cmds/monkey/README.NETWORK.txt

it's a tool for testing apps, and the port indicates which porto to connect (binds to localhost) to issue remote commands