Blogger Information
Blog 8
fans 0
comment 1
visits 4287
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Appium 链接 安卓手机 进行调试
lucia打工人
Original
365 people have browsed it

Macbook 环境

前提


  1. 安装 Appium server 及 Appium Inspector -- 提供debug 平台

    Set Appium environment variables(skd and jdk home, can use command(java -verbose) to check below Java information in your macbook/windows 

    截屏2023-03-08 16.27.25.png

  2. 安装 Android studio -- 提供 adb 命令及 编码环境

  3. 打开手机的 开发者模式 -- 手机可调式模式

    Setting -----About Phone-- ----Version Number-----continue to click 7 times to turn on the developer mode And then you will see 'Developer Mode' Turn on the ''USB debug' in Developer Mode page 

  4. 手机安装可供 debug 的 app -- 可以 debug的 软件

使用Appium inspector 协助 获取 Element 的信息

  • 终端Terminal cmd 这个 命令 获取  appium:appPackage and appium:appActivity

adb shell dumpsys window windows

截屏2023-03-08 16.07.44.png

  • 在终端输入 'adb devices' ,获取到 device 的 信息

  • 在Appium Inspector 上面 创建一个新的 Capability set

截屏2023-03-08 16.16.31.png

android

{
 "platformName": "Android",
 "appium:deviceName": "6eb026b6",
 "appium:automationName": "UiAutomator2",
 "appium:noReset": true,
 "appium:fullReset": false,
 "appium:appPackage": "xxx",
 "appium:appActivity": "xxx"
}

iOS

{
 "platformName": "iOS",
 "deviceName": "iPhone 13",
 "platformVersion": "15.5",
 "app": "xxxx",
 "automationName": "XCUITest",
 "noReset": true,
 "fullReset": false
}

  • Start Appium server

  • Connect your android phone devices to your computer by USB debug, and start Appium session

截屏2023-03-08 16.34.40.png

常见问题及 解决方案

在Android 真机上无法运行Appium inspector?Failed to create session

安卓真机调试[INSTALL_FAILED_ABORTED: User rejected permissions]

连接真机,Appium启动Session时报错:settings delete global hidden_api_policy‘‘ exited with code 255‘






Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!