Identify Android device type - is it phone or tablet

216 views
Skip to first unread message

Kateryna Ts

unread,
Dec 9, 2014, 5:25:24 PM12/9/14
to calabash...@googlegroups.com
Hello,

I didn't find any solution to the question in the group and internet at all, could you please help me to resolve it.

Question: how to identify whether the device type, on which the test is running, is a phone or tablet?

Solution found:
adb shell command: device_type = %x[adb shell getprop ro.build.characteristics]
BUT
when I have severals devices connected to one machine it gives an error: error: more than one device and emulator

So is there any method to define this information about the device current test is running on?

Thank  you.

Sher Bhachu

unread,
Feb 18, 2015, 6:39:12 AM2/18/15
to calabash...@googlegroups.com
adb -s DEVICE_SERIAL shell command: device_type = %x[adb shell getprop ro.build.characteristics]

Kateryna Tsymbaliuk

unread,
Feb 18, 2015, 8:43:39 AM2/18/15
to calabash...@googlegroups.com

Thank you for the reply,

when I have severals devices connected to one machine - how to identify DEVICE_SERIAL of the device the test currently is executing on?

Sher Bhachu

unread,
Feb 18, 2015, 11:06:56 AM2/18/15
to calabash...@googlegroups.com
well, to get the list of devices..

adb devices

you need to explicitly tell the system what device serial you want to run the tests against, so that problem is not going to occur.
Reply all
Reply to author
Forward
0 new messages