appium+adb命令操作终端的原理 (以Appium启动流程为例)

一. Appium 根据 desired capabilities 连接终端的关键步骤

在之前的系列文章 Android-APPUI自动化搭建步骤 中, 我们定义了如下的 desired capabilities (相关参数在本文中已脱敏):

{
   
  "platformName": "Android",
  "platformVersion": "11",     // Android 版本
  "appPackage": " your app ",  // app 包名 (需改成你自己的)
  "appActivity": "your activity",  //  自动化打开 app 初始的的页面名, 须改成你自己的
  "noReset": "True",   // 表示每次打开 app 不清空用户信息
  "udid": "vgorl7pjcu55uwp7"   // 真机唯一设备 id
}

试截取连接终端时 Appium Desktop 中显示的部分关键日志, 分析 desired capabilities 的作用

1.客户端与Appium 服务端建立连接 (其实这里还没有用到 desired capabilities, 只是 appium inspector 这个客户端根据默认的 appium server 地址: 127.0.0.1:4723 建立的 http 连接)

[BaseDriver] Creating session with MJSONWP desired capabilities: {
[BaseDriver]   "appActivity": "xxxxxxxxxxxxxxxxxxx",
[BaseDriver]   "appPackage": "xxxxxxxxxxxxxxxx",
[BaseDriver]   "ensureWebviewsHavePages": true,
[BaseDriver]   "noReset": "True",
[BaseDriver]   "platformName": "Android",
[BaseDriver]   "platformVersion": "11",
[BaseDriver]   "udid": "vgorl7pjcu55uwp7",
[BaseDriver]   "newCommandTimeout": 0,
[BaseDriver]   "connectHardwareKeyboard": true
[BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   connectHardwareKeyboard
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值