Appium with more than one Genimotion devices

Hi!

I’m having some issues when running Appium with two devices on emulated by Genimotion. I tryed setting the udid capabilities to distinguish the devices, but it keeps getting the same error. The ideia is that each Appium server uses its own device.

Error Message
self.driver = webdriver.Remote(SetupCrawler.APPIUM_HOST, self.dc)
File “C:\Users\Suporte\miniconda3\lib\site-packages\appium\webdriver\webdriver.py”, line 151, in init
super().init(
File “C:\Users\Suporte\miniconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 157, in init
self.start_session(capabilities, browser_profile)
File “C:\Users\Suporte\miniconda3\lib\site-packages\appium\webdriver\webdriver.py”, line 225, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File “C:\Users\Suporte\miniconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 321, in execute
self.error_handler.check_response(response)
File “C:\Users\Suporte\miniconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original
error: Error executing adbExec. Original error: ‘Command ‘C:\Users\Suporte\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 192.168.52.101:5555 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: ‘1’

Appiuim Log
Running ‘C:\Users\Suporte\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 192.168.52.101:5555 forward --remove tcp:8200’
[UiAutomator2] Unable to remove system port forward: Error executing adbExec. Original error: ‘Command ‘C:\Users\Suporte\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 192.168.52.101:5555 forward --remove tcp:8200’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: ‘1’
[BaseDriver] Event ‘newSessionStarted’ logged at 1613588748619 (16:05:48 GMT-0300 (Horário Padrão de Brasília))
[W3C] Encountered internal error running command: Error executing adbExec. Original error: ‘Command ‘C:\Users\Suporte\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 192.168.52.101:5555 forward tcp:8200 tcp:6790’ exited with code 1’; Stderr: ‘adb.exe: error: more than one device/emulator’; Code: ‘1’
[W3C] Error: Command ‘C:\Users\Suporte\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 192.168.52.101:5555 forward tcp:8200 tcp:6790’ exited with code 1
[W3C] at ChildProcess. (C:\Users\Suporte\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\teen_process\lib\exec.js:113:19)
[W3C] at ChildProcess.emit (events.js:203:13)
[W3C] at maybeClose (internal/child_process.js:1021:16)
[W3C] at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
[W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 3328 ms - 1203

Setup:
Windows 10
Appium-Python-Client: 1.0.2
Python 3.8.5
Adb: 1.0.41
SDK Platform-Tools: 30.0.5

Genymotion Desktop: 3.2.0
Devices: Samsung Galaxy S7 with Android 7.1

What is the output of adb devices -l ?

It lists both of the devices emulated,

List of devices attached
192.168.52.101:5555 device product:vbox86p model:Samsung device:vbox86p transport_id:7
192.168.52.105:5555 device product:vbox86p model:Samsung_Galaxy_S7_2 device:vbox86p transport_id:8

This looks more like an adb bug. Make sure it is up to date

Also possible duplicate of Unable to run automation using Genymotion if multiple devices are started

1 Like