Monkey Runner - 在 Java 类中使用它向模拟器发送命令

发布于 2024-11-24 17:10:09 字数 640 浏览 4 评论 0原文

我正在尝试使用这个猴子跑步者Java类这里,它是从< a href="http://www.netmite.com/android/mydroid/2.0/development/tools/monkeyrunner/src/com/android/monkeyrunner/" rel="nofollow">此处。看起来确实不错,但是每次运行时都会出现此错误:

02:01:38 E/adb:无法获取 adb 版本:无法运行程序 "adb": CreateProcess error=2, 系统找不到该文件 指定

我确保转发并启动猴子服务器,如下所示:

adb 转发 tcp:1080 tcp:1080

adb shell 猴子 --端口 1080

我在 Eclipse 中运行这个类。我做错了什么?

我还希望链接到在 Java 类中使用 Monkey runner 将命令发送到模拟器的示例。我不想使用 Python/Jython 脚本,我想在 Java 类中执行此操作。

I am trying to make use of this monkey runner Java class here which was obtained from here. It looks really good, however, every time I run it I get this error:

02:01:38 E/adb: Failed to get the adb version: Cannot run program
"adb": CreateProcess error=2, The system cannot find the file
specified

I make sure to forward and start the monkey server like so:

adb forward tcp:1080 tcp:1080

adb shell monkey --port 1080

I am running this class within eclipse. What am I doing wrong?

I would also appreciate links to examples of using the monkey runner in a Java class to send commands to an emulator. I don't want to use Python/Jython script I want to do it within a Java class.

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

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

发布评论

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

评论(1

淡看悲欢离合 2024-12-01 17:10:09

如果您使用的是 Windows,则 adb 可能不在系统路径上,而是在用户路径上。并且 eclipse 正在以另一个用户身份运行它,因此找不到 adb.exe。

If you'r using windows maybe the adb is not on the system path but on the user path. And eclipse is running it as another user and therefore can't find the adb.exe.

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