zoukankan      html  css  js  c++  java
  • appium-1.2-启动Android设备

    1)单个Android设备启动

    #server固定写法
    server = 'http://localhost:4723/wd/hub'
    # app启动参数
    # platformName设备名称是Android还是ios
    #appPackage  appActivity需要启动的包名
    #
    desired_caps = {
    "platformName": "Android",
    "deviceName": "06599afc7d24",
    "appPackage": "com.taobao.idlefish",
    'newCommandTimeout': "2000",
    "appActivity": "com.taobao.fleamarket.home.activity.MainActivity",
    "noReset":"True",
    "automationName":'UiAutomator2',
    'avdLaunchTimeout':'300'
    }
    # 驱动
    driver = webdriver.Remote(server, desired_caps)
    driver.implicitly_wait(30)
    #隐式等待30秒,适用于后面所有的driver,都会等待30秒

    备注:查询包名的方式,cmd打开

    adb shell dumpsys window w |findstr / |findstr name=

    2)多个Android设备启动

    #多一个udid
    desired_caps = {
    "platformName": "Android",
    "deviceName": "06599afc7d24",
      "udid":"xxxxx",
    "appPackage": "com.taobao.idlefish",
    'newCommandTimeout': "2000",
    "appActivity": "com.taobao.fleamarket.home.activity.MainActivity",
    "noReset":"True",
    "automationName":'UiAutomator2',
    'avdLaunchTimeout':'300'
    }

    备注:查询udid的方式,cmd打开

    adb devices

     

  • 相关阅读:
    MySQL 触发器
    MySQL视图
    MySQL中的存储过程和函数
    Mysql数据库连接查询
    数据库(MySQL)表基本操作
    Spring MVC---数据绑定和表单标签
    Spring MVC---基于注解的控制器
    Spring基于AOP的事务管理
    Ubuntu下通过wine安装HeidiSQL
    chmod命令详解
  • 原文地址:https://www.cnblogs.com/SparkProgram/p/13346299.html
Copyright © 2011-2022 走看看