yyogenMod 上的 Monkeyrunner 的 Python 脚本

发布于 2024-12-27 23:36:23 字数 1717 浏览 1 评论 0原文

我有一些脚本可以在 htcdesire 上完美运行,并且有意义。但是,当我使用cyanogenMod 在 htcdesire 上启动脚本时,它会抛出很多奇怪的异常。有人熟悉这类话题吗?

例如,我有一个脚本,在感觉上运行完全良好,但在氰基上它会抛出 time.sleep(10) 的异常,如果我注释掉这个(在氰基上),我运行时不会有异常,但如果我给一些时间睡觉它会抛出异常

120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error sending touch event: 150 700 DOWN_AND_UP
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]java.net.SocketException: Broken pipe
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite0(Native Method)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)

我不明白为什么 time.sleep 对氰基抛出异常:S。 。 。

笔记: 我在sense和cyanogenMod上运行相同的脚本,在sense上工作没有问题cyanogen它在time.sleep上抛出破损的管道。 。 。

谢谢

I have some scripts that run perfectly on htc desire with sense on it. But when I start my scripts on htc desire with cyanogenMod it throws a lot of weird exception. Is anybody familiar with this kind of topic ?

for example I have script that runs entirely good on sense, but on cyanogen it throws exception for time.sleep(10), if I comment this out (on cyanogen) I runs with no exception but if I give some time to sleep it throws

120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error sending touch event: 150 700 DOWN_AND_UP
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]java.net.SocketException: Broken pipe
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite0(Native Method)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
120119 14:06:18.555:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)

I do not understand why time.sleep throws exception on cyanogen :S . . .

NOTE:
I run the same script on sense and cyanogenMod, in sense work with no problems on cyanogen it trows broken pipe on time.sleep . . .

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ま柒月 2025-01-03 23:36:23

这只是一个建议。您是否尝试过更改睡眠方法的时间。有时可能会出现一些线程超时问题。只需尝试 2 或 3 秒的睡眠方法即可。

This is only a suggestion. Have you tried with changing the time on your sleep method. sometimes there may be some thread timeout issues. Just try out with 2 or 3 seconds to your sleep method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文