appium-device-farm icon indicating copy to clipboard operation
appium-device-farm copied to clipboard

Improvement - add a cap for filtering on android phones vs tablets similar to iphone / ipad

Open EllaVader opened this issue 11 months ago • 4 comments

Enhancement for Android Devices:

Currently, passing in caps df:iPhoneOnly or df:iPadOnly is a really nice way of being able to run test on different ios device types. It would be helpful to have something similar for android phones / tablets as well. I know we can set tags and use those, but that involves manual intervention in the dashboard.

Is there a way to have filter on AndroidPhone and AndroidTablet? Or if not a way to programmatically set the tags?

EllaVader avatar Jan 02 '26 17:01 EllaVader

@EllaVader Do you how we can differ phone and tablet in Android through adb ?

saikrishna321 avatar Jan 03 '26 10:01 saikrishna321

@saikrishna321 You can't get this info properly. For getting info about android device type you can try use wm size and wm density commands. Then you should divide width and height by density and find diagonal: x = width / density, y = heigth / density diagonal = sqrt( sqr(x) + sqr(y) ) And match this value to standard sizes (e.g. my phone has 6.67 inches -> phablet, so it bigger than 6.5) Hope this helps)

GFPCommand avatar Jan 04 '26 09:01 GFPCommand

@saikrishna321 You can't get this info properly. For getting info about android device type you can try use wm size and wm density commands. Then you should divide width and height by density and find diagonal: x = width / density, y = heigth / density diagonal = sqrt( sqr(x) + sqr(y) ) And match this value to standard sizes (e.g. my phone has 6.67 inches -> phablet, so it bigger than 6.5) Hope this helps)

Is it possibly to set the df tags programmatically? Is there an endpoint to use to set them based on calculating the width/height of running devices?

EllaVader avatar Jan 06 '26 13:01 EllaVader

it would be helpful if device farm had the logic in it similar to the df:iPhoneOnly and df:iPadOnly so then we can pass that it as part as an appium option

EllaVader avatar Feb 02 '26 17:02 EllaVader