Android 猴子跑步脚本
抛出错误异常
Can't open specified script file
Usage: monkeyrunner [options] SCRIPT_FILE
-s MonkeyServer IP Address.
-p MonkeyServer TCP Port.
-v MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO,
WARNING, SEVERE, OFF)
我正在尝试通过 Monkey runner 命令提示符执行示例 python 程序,它在线程“main”java.lang.NullPointerException 中 所以任何人都可以指导我如何解决这个问题
i am tryig to execute a sample python program through monkey runner command prompt and it is throwing an error
Can't open specified script file
Usage: monkeyrunner [options] SCRIPT_FILE
-s MonkeyServer IP Address.
-p MonkeyServer TCP Port.
-v MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO,
WARNING, SEVERE, OFF)
Exception in thread "main" java.lang.NullPointerException
so any one can guide me how to resolve this one
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
scriptfile 应该是完整路径文件名
尝试下面
monkeyrunner c:\test_script\first.py
scriptfile should be a full path file name
try below
monkeyrunner c:\test_script\first.py
尝试使用类似的东西
,其中
first.py
是我的示例 python 脚本,我将其复制到 android SDK 的工具文件夹中(monkeyrunner.bat
所在的位置)try using something like
where
first.py
was my sample python script which I copied into tools folder of android SDK (the place wheremonkeyrunner.bat
is located)在所有 unix/linux 系列操作系统下都可以使用 sha bang 语法。
使用以下命令的结果编辑脚本的第一行:
例如,如果 Monkeyrunner(通常随 android sdk 提供)已安装在 /usr/local/bin/sdk 下,则写入:
或者甚至使用“env”
,然后设置您脚本文件作为可执行文件
您现在可以从 shell 启动脚本。
Under all unix/linux families OS the sha bang syntax can be used.
Edit the first line of your script with the results of the following command:
for example, if monkeyrunner (usually provided with android sdk) has been installed under /usr/local/bin/sdk write:
or even use "env"
then set you script file as executable
You can now launch your script from the shell.
将工作目录切换到 Android SDK 文件夹看起来没有意义,而只是为了获取其自身的一些相对引用路径。这意味着您必须指定脚本文件以及要保存或比较的 PNG 图像文件的完整路径。
更好的方法是修改 SDK 文件夹下“monkeyrunner.bat”中的几行,如下所示。这将使用您当前的路径作为工作目录,因此无需使用完整路径文件名。
It looks not make sense to switch working directory to Android SDK folder but just for obtain some relative references path for itself. It means you have to specify the full path for your script file and the PNG image files you want to save or compare to.
A better way is modify few lines in the "monkeyrunner.bat" under your SDK folder as below. This will use your current path as working directory, so, no necessary to use full path file name.
我遇到了和你一样的事情,我通过使用工具下的“monkeyrunner”命令解决了,你的脚本文件应该是完整的路径名。看起来“tools”目录是MonnkeyRunner的主目录。我很沮丧,我无法直接通过 pydev IDE 运行我的脚本文件。
I met the same things as you did, I resolved by using "monkeyrunner" command under tools, and your script file should be a full path name. It looks like the directory “tools” is the main directory of MonnkeyRunner. I am depressed that I can't run my script files by pydev IDE directly.
Monkeyrunner.bat cygpath -w $(pwd)/monkey.py
monkeyrunner.bat
cygpath -w $(pwd)/monkey.py