I perform remote mobile tests in the appium container.
On my computer I have an appium container based on the docker image appium/appium:v1.22.3-p1 with java 17 and maven 3.6.3.
I have an adb server running on a remote linux machine (on the local network), where smartphones are connected via USB. According to the [documentation][1].
When I have one smartphone connected to the remote server via USB and the test code is set to its UDID, everything works as it should.
UiAutomator2Options options = new UiAutomator2Options();
[...]
options.setRemoteAdbHost("10.38.223.243");
options.setAdbPort(5038);
options.setUdid(R58N12HEW3E);
However, if 3 smartphones are connected to the remote server and the test code is the same (aimed directly at one of the smartphone)
adb devices
List of devices attached
8e410c3e device
R58N12HEW3E device
RZCT50M61JX device
I am getting an error.
Could not start a new session. Response code 500. Message: An unknown server-side error
occurred while processing the command. Original error: Error executing adbExec. Original
error: 'Command '/opt/android/platform-tools/adb -H 10.38.223.243 -P 5038 -s R58N12HEW3E
forward tcp\:8200 tcp\:6790' exited with code 1';
Command output: adb: error: more than one device/emulator
Evidently there is a problem with "adb forward" even though the -s flag is used. I've been struggling with this problem for a few days now. I am asking for advice.
Thanks! [1]: https://github.com/appium/appium-docker-android#connect-to-an-adb-server