Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
migrate-bricks opened this issue May 11, 2024 · 3 comments
Closed

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

migrate-bricks opened this issue May 11, 2024 · 3 comments

Comments

@migrate-bricks
Copy link

migrate-bricks commented May 11, 2024

以下的代码在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
Copy link
Member

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

@migrate-bricks
Copy link
Author

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

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

@migrate-bricks
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants