VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > temp > C#教程 >
  • airtest本地连接和远程连接

一.本地连接

# -*- coding: utf-8 -*-#
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
from airtest.core.api import *
class_name = '059b670d0c634127'
connect_device(f"Android:///{class_name}?cap_method=JAVACAP&&ori_method=ADBORI&&touch_method=ADBTOUCH")
#其中cap_method=JAVACAP&&ori_method=ADBORI&&touch_method=ADBTOUCH 对应你在airtest编辑器上连接时候的勾选
dev=set_current(class_name) 
#多机操作时候需要加,切换到你想要操作的机子上
poco = AndroidUiautomationPoco(device=dev,use_airtest_input=True, screenshot_each_action=False)

二.远程连接

手机建立服务
adb tcpip 5555
查看手机ip
adb shell ifconfig wlan0  #其中 inet addr:xxxxx就是了
进行连接
adb connect 手机ip:5555



出  处:https://www.cnblogs.com/pythonywy/p/13753353.html


相关教程