Connect to a specific device in Monkey script
There are cases when you run many emulators in order to test their functions like sending messages, calling to each others …
and in Monkey scripts you need to connect to specific one.
Look at documentation on MonkeyRunner, you’ll see how to connect to a specific device:
Sample: if I want to connect to a device: “emulator-5556”, my connection part of script would be like:
device = MonkeyRunner.waitForConnection(120, "emulator-5556")
That’s all for it, now you can handle the rest of automation test for device.