如何使用 Appium 驱动程序获取设备名称和应用程序版本 [英] How to get Device name and App Version using Appium Driver

查看:29
本文介绍了如何使用 Appium 驱动程序获取设备名称和应用程序版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用

driver.getCapabilities().getCapability("platformVersion");

同样,我将如何获取设备名称和应用程序版本.我尝试了以下但没有用

Simillarly how I will get device name and version of app. I tried with following but no use

driver.getCapabilities().getCapability("deviceName");
driver.getCapabilities().getCapability("appVersion");

推荐答案

使用 Adb

获取设备名称

adb.exe -s " +deviceID+ " shell getprop ro.product.model

获取设备操作系统版本

adb.exe -s " +deviceID+ " shell getprop ro.build.version.release

获取应用版本

adb -s " +deviceID+ " shell dumpsys package yourPackageName | grep versionName

这篇关于如何使用 Appium 驱动程序获取设备名称和应用程序版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆