类型"&QUOT之间的延迟;命令中AdbClient(它不于monkeyrunner存在) [英] Delay between "type" commands in AdbClient (which doesn't exist in monkeyrunner)

查看:373
本文介绍了类型"&QUOT之间的延迟;命令中AdbClient(它不于monkeyrunner存在)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从monkeyrunner切换到AndroidViewClient。这是不错的,因为它是所有的Python。然而,发行类型或preSS命令时,每个命令之间的时间差很象在第二种:

I am making a switch from monkeyrunner to AndroidViewClient. It is nice because it is all Python. However, when issuing type or press commands, the lag between each command is like one second:

import sys
import os
import time
try:
    sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src'))
except:
    pass

from com.dtmilano.android.adb.adbclient import AdbClient, Device        

device.type("hello")
# type a space
device.press('KEYCODE_SPACE', 'DOWN_AND_UP')
device.type("world")

以上code在monkeyrunner有间preSS从字面上无延迟型。为什么AdbClient生产这种延迟?是不是经历了亚洲开发银行的壳呢?它应该是快...

The above code in monkeyrunner has literally no delay between "press" and "type." Why is AdbClient producing this delay? Isn't it going through the adb shell? It should be fast...

注:你好和世界的打字速度快。它只是有每种类型的命令之间的延迟1秒。

Note: the typing of "hello" and "world" IS fast. It is just there is a 1 second delay between each type command.

推荐答案

原因命令之间的一些延迟是 adbclient 大都采用一个连接送他们。这个外壳连接不保持开放。 monkeyrunner 使用一个插座将命令发送到猴子,因此为什么命令之间的延迟是最小的。 adbclient 可以重新使用一个开放连接或打开插槽猴子做的 monkeyrunner

The reason for some delay between command is that adbclient uses mostly a shell connection to send them. This shell connection is not kept open. monkeyrunner uses a socket to send commands to monkey and thus why the delay between command is minimum. adbclient could re-use an open shell connection or open a socket to monkey to do as monkeyrunner.

这并不难实现,但不是在路线图呢。无论如何,补丁总是受欢迎的。

This is not difficult to implement, but not in the roadmap yet. Anyway, patches are always welcome.

在另一方面,对于其他的最常见的情况下, adbclient 快sevral倍:的http://dtmilano.blogspot.ca/2013/09/androidviewclientculebra-takesnapshot.html

On the other hand, for other most common cases adbclient is sevral times faster: http://dtmilano.blogspot.ca/2013/09/androidviewclientculebra-takesnapshot.html

这篇关于类型"&QUOT之间的延迟;命令中AdbClient(它不于monkeyrunner存在)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆