How to get the Android version of smartphones with adb when 2 smartphones have same UDID?

ENVIRONMENT

I am making a parallel test with real Android smartphones with Appium v1.17.0 and Python 3.7. The smartphones are connected to my Windows 10 64bits where my python script is running.

For running the test, I start Appium server and open each driver on a different port for each smartphone.
To start the driver, I need to set up the desired capabilities which are:

automationName

platformName

platformVersion

deviceName

udid

systemPort

etc…

I get it all. I get the Android version with the adb command:

adb -s <UDID> shell getprop ro.build.version.release

THE PROBLEM:

I have 2 real Android devices with the same UDID connected. So when I run this adb command I get this error message output:

error: more than one device

So I tried different stuff with “adb getprop”. I searched on Google and Appium forum, but I couldn’t find a solution to my problem.

So that makes me think of 2 solutions:

  • Or I am able to change the UDID of one smartphone and my problem is fixed

  • Or it exists a specific command to get Android version in the case where 2 or several smartphones have the same did?

Do you have any idea how can I fix that please?

1 Like

THank you so much. THe stackoverflow answers are full of information!