openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.18k stars 1.35k forks source link

uiautomator2 3.0.11版本的swipe_ext方法性能非常差 #969

Closed migrate-bricks closed 1 month ago

migrate-bricks commented 2 months ago

以下的代码在3.0.8版本和3.05版本都在1秒以内,如图所示,升级到3.0.11之后,滑动效果非常卡,并且每次滑动耗时3秒左右 测试手机:Redmi note 11t pro miui 14.0.7

import uiautomator2 as u2 from datetime import datetime

d = u2.connect('AUE66HL7XWIVJRSS') # 替换为你的设备序列号,如果已连接设备可省略此参数

max_scroll = 10

for i in range(max_scroll): print(datetime.now()) d.swipe_ext("up", scale=0.9)

image

codeskyblue commented 2 months ago

可能是localhost解析成ipv6地址导致的慢,你换成 uiautomator2 3.0.13 试试

migrate-bricks commented 2 months ago

可能是localhost解析成ipv6地址导致的慢,你换成 uiautomator2 3.0.13 试试

好像3.0.13还无法通过pip install 安装,我直接下载试试

migrate-bricks commented 2 months ago

更新3.0.13之后性能确实有改善,谢谢,估计是解释域名出现问题