appium获取真机参数
时间: 2023-10-13 12:04:42 浏览: 256
根据提供的引用内容,可以使用以下代码来获取真机参数:
```python
from appium import webdriver
desired_caps = {
"platformName": "Android",
"deviceName": "vivo_X9",
"platformVersion": "7.1.2",
"appPackage": "com.tencent.mm",
"appActivity": ".ui.LauncherUI",
"noReset": True
}
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
```
这段代码使用了appium库中的webdriver模块,并设置了手机及APP的参数。其中,platformName指定了平台为Android,deviceName指定了手机型号为vivo_X9,platformVersion指定了系统版本为7.1.2,appPackage指定了应用程序名为com.tencent.mm,appActivity指定了app的激活方式为.ui.LauncherUI,noReset设置为True表示不重置登录状态。最后,通过webdriver.Remote方法连接到appium服务器。
#### 引用[.reference_title]
- *1* [Appium连接真机时启动参数的配置与Appium元素定位使用方法](https://blog.csdn.net/weixin_44801980/article/details/115025095)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Appium----Appium连接真机启动App](https://blog.csdn.net/redrose2100/article/details/129191288)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Python+appium获取手机及APP参数](https://blog.csdn.net/qq_43490217/article/details/121416158)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文