如何使用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帖子 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屋!