Appium 链接 安卓手机 进行调试
安装 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
安装 Android studio -- 提供 adb 命令及 编码环境
打开手机的 开发者模式 -- 手机可调式模式
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
手机安装可供 debug 的 app -- 可以 debug的 软件
终端Terminal cmd 这个 命令 获取 appium:appPackage and appium:appActivity
adb shell dumpsys window windows
在终端输入 'adb devices' ,获取到 device 的 信息
在Appium Inspector 上面 创建一个新的 Capability set
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
常见问题及 解决方案
在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‘