如何使用Appium在ios中获取应用程序版本,设备操作系统版本等应用程序信息? [英] How to get app information like app version, device os version in ios using Appium?
问题描述
我正在使用 appium 测试应用程序并将测试输出集成到 testrail 中.我需要在 testrail 中添加设备和应用程序信息.在android中,我可以使用如下的adb命令获取应用程序和设备信息,如设备型号、设备版本和应用程序版本:
I am testing the app using appium and integrating the test output in testrail. I need to add the device and app information in the testrail. In android i am able to get app and device information like device model, device version and app version using adb command like following:
adb -s 012313gasda shell getprop ro.product.model
adb -s 012313gasda shell getprop ro.build.version.release
adb -s 012313gasda shell dumpsys package com.test.app |grep versionName
我怎样才能为 ios 获得相同的信息?使用以下命令将返回您在所需功能中设置的设备名称和操作系统版本
How can i achieve the same information for ios? using following command will return you the device name and OS version as set in desired capabilities
driver.getCapabilities().getCapability("deviceName").toString();
driver.getCapabilities().getCapability("CapabilityType.VERSION").toString();
有没有办法获取 ios 的设备和应用信息?
Is there anyway to get device and app information for ios?
推荐答案
您可以使用 ideviceinfo 执行类似于 adb 的操作,例如在此 SO post 中https://stackoverflow.com/a/55028994/8016330
You can do something similar to adb using ideviceinfo such as in this SO post https://stackoverflow.com/a/55028994/8016330
PRODUCT_NAME=$(ideviceinfo --udid $DEVICE_UDID --key ProductName)
PRODUCT_TYPE=$(ideviceinfo --udid $DEVICE_UDID --key ProductType)
PRODUCT_VERSION=$(ideviceinfo --udid $DEVICE_UDID --key ProductVersion)
HTH
詹姆斯
这篇关于如何使用Appium在ios中获取应用程序版本,设备操作系统版本等应用程序信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!