• 命令行运行脚本


    本地部署python环境
      Python(2.7或<=3.6),我们更推荐使用 Python3 ,如果你愿意的话我们也同样建议使用 virtualenv 等虚拟环境新建一个干净的python环境
      pip install airtest
      pip install pocoui

    使用python命令行运行脚本

    方法1:
      以下是一个使用命令行运行的例子:
        >airtest run untitled.air --device Android:///手机设备号 --log log/
        >python -m airtest run untitled.air --device Android:///手机设备号 --log log/
      这两个命令行的效果是相同的,我们用airtest运行了一个叫做 untitled.air 的脚本,传入了 --device 和 --log 两个参数,分别是我们的手机设备和log输出目录。
      airtest run 命令必须传入的参数是指定脚本的路径,其他可选参数有 --device 指定 设备字符串 ,--log 指定 log输出目录

    方法2: 

      以普通python脚本的方式来运行

        在 .py 脚本文件中 import airtest/poco ,使用 connect_device 接口即可:

      from airtest.core.api import *
      connect_device("Android:///")  # 同样是设备字符串



    在平时的脚本运行中
      # 什么都不填写,会默认取当前连接中的第一台手机
      Android:///
      # 连接本机默认端口连的一台设备号为79d03fa的手机
      Android://127.0.0.1:5037/79d03fa
      # 连接一个Windows窗口,窗口句柄为123456
      Windows:///123456
      # 连接一个Windows窗口,窗口名称匹配某个正则表达式
      Windows:///?title_re=Unity.*
      # 连接iOS手机

      iOS:///127.0.0.1:8100

  • 相关阅读:
    C++中四种类型转换方式
    LeetCode——Move Zeroes
    LeetCode——Construct the Rectangle
    LeetCode——Add Digits
    LeetCode—— Invert Binary Tree
    LeetCode——Sum of Two Integers
    LeetCode——Find the Difference
    LeetCode——Maximum Depth of Binary Tree
    kafka 安装及部署
    apache kafka系列之server.properties配置文件参数说明
  • 原文地址:https://www.cnblogs.com/xuanjian-91/p/10348853.html
Copyright © 2020-2023  润新知