运行monkeyrunner出现SWT folder '..\framework\x86' does not exist报错

运行monkeyrunner,出现错误

C:\Users\Apptest>monkeyrunner
SWT folder '..\framework\x86' does not exist.
Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.

用记事本打开monkeyrunner.bat文件 
修改以下位置

for /f %%a in ("%APP_HOME%\lib\monkeyrunner-25.3.2.jar") do set jarfile=%%~nxa
set frameworkdir=.
set libdir=
rem-----------------------------------------------------------------------
rem 注释下面的4rem if exist %frameworkdir%\%jarfile% goto JarFileOk
rem   set frameworkdir=lib

rem if exist %frameworkdir%\%jarfile% goto JarFileOk
rem   set frameworkdir=..\framework

rem 手动修改文件
set frameworkdir=..\lib
rem---------------------------------------------------------------------------
:JarFileOk

然后执行monkeyrunner会发生adb找不到的错误 
在tools下新建framework文件夹,复制adb.exe到此文件夹下.

当然,如果你有多个adb或者安装了XX手机助手…你的adb可能会出错,关掉别的adb就好了. 

你可能感兴趣的:(monkey)