android adb如何发送输入点击连续延迟0秒

问题描述 投票:0回答:1

我想创建一个程序来自动连续点击屏幕Android手机。

我在循环中尝试了“adb shell input tap x y”,但速度很慢(大约1秒)。 我尝试了多个命令,例如:“adb shell input tap x1 y1 && adb shell input tap x2 y2”,但无法解决我的问题。

这个动作要怎么做?我发送了一张礼物图片以了解详细信息。 my real action in phone

android adb
1个回答
0
投票

正如 @Robert 提到的,仅运行 1 个 adb shell,然后在循环中执行

input tap
会提高速度。 但是,避免每次都执行新的
input
,您可以获得更好的速率。

使用 AndroidViewClient/culebraCulebraTester2-public 后端,您将能够获得这样的值。

#! /usr/bin/env python3

import timeit
from com.dtmilano.android.viewclient import ViewClient

helper = ViewClient.view_client_helper()
print(f"{timeit.timeit('helper.ui_device.click(500, 500)', number=1, globals=globals()):.4f}s")

给予(在模拟器上):

⚠️  CulebraTester2 server should have been started and localport 9987 redirected to remote port 9987.
0.1796s

这样你就可以跑了

helper.ui_device.click(x, y)

循环快速点击。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.