Unable to run automation using Genymotion if multiple devices are started

The automation works if I have single or multiple physical devices (USB connected), and with Genymotion it only works with single instance. Is there any special setting that I am missing since Genymotion devices are technically are tcpip remote devices.

Here is my setup:
Appium version 1.17.1
Android Debug Bridge version 1.0.41
Appium-Python-Client 0.49

Here is the result of adb devices -l:

192.168.58.102:5555 device product:vbox86p model:Samsung device:vbox86p transport_id:13
192.168.58.103:5555 device product:vbox86p model:Google device:vbox86p transport_id:15

Here is the issue that I see when I try running it with 2 devices:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘adb -P 5037 -s 192.168.58.102:5555 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb: error: more than one device/emulator’; Code: ‘1’

I clearly have more than one device, but I provide ip with port to identify the device. I tried to replace ip with “model:Samsung” and “model:Google” since this works as a substitute to ip or UDID, but it was not able to find the device with it. If I run this adb command that has an issue I get the same response that there are multiple devices/emulators…

Is there any way to point to a specific device? I saw that somebody mentioned that it was introduced in Android Debug Bridge version 1.0.40, but I have no clue how to get 1.0.39…

====EDIT====
The issue happened due to one device being cloned multiple times. Creating a new device and rebooting the machine fixed the issue.

2 Likes

Being stuck on this problem for a few days, I solved it by replacing android’s ADB with genymotion’s included adb binary. Probably something to do with the genymotion’s adb running while player is running.