Monkey Runner - 在 Java 类中使用它向模拟器发送命令
我正在尝试使用这个猴子跑步者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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 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.