Can I get device configuration through appium?

Hi,

There is a requirement in my project where I need to click on some of the coordinates, within the object. For that I need to have device configuaration (i.e; screen resolution, os version, etc). Can I get that on runtime through appium or any other Java method?

Hi Mashkurm,
You can get device configuration info (i.e; screen resolution, os version, etc) at runtime by executing adb commands in simple java code such as:
For Screen Resolution : adb -s “Device ID” shell wm size
For OS version: adb -s “Device ID” shell getprop ro.build.version.release
and so on…

I hope this will resolve your issue :wink:

Regards
Abdul Sathar Beigh

2 Likes

Something I collected try these , run these commands using Java program…

adb devices : To view attached devices to machine
adb logcat : To view running logs inside attached device
adb shell getprop ro.product.model :- Get’s the attached device model no
adb get-serialno : Get’s the attached device unique serial number (n/a for emulator)
adb shell getprop ro.build.version.release : Build release version i.e. 4.4.2/4.4.4
adb shell getprop ro.build.version.sdk :- Build sdk/api version i.e. 19,20,21,22
adb –s shell : To execute above command’s in case we have multiple attached device

1 Like

Thanks, @Abdul_Sathar_Beigh, @amitjaincoer191, it helped a lot. I was actually looking for resolution, but now that I am having the model numbers, I am having a set of devices and I will set resolution dynamically in properties file specific for models got form the commands above.

Thanks for the help.