Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Monkeyrunner.bat path on Step 6 is wrong (Windows) #41

Open
PaulRashidi opened this issue Jan 4, 2018 · 1 comment
Open

Monkeyrunner.bat path on Step 6 is wrong (Windows) #41

PaulRashidi opened this issue Jan 4, 2018 · 1 comment

Comments

@PaulRashidi
Copy link
Contributor

gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:installDebug :app:installDebugAndroidTest

%ANDROID_HOME%\tools\bin\monkeyrunner.bat run_perf_tests.py .\ <INSERT_ID>

Even after resolving the ANDROID_SWT variable issue with monkeyrunner with the below command it seems like monkeyrunner.bat is broken for Windows.

set ANDROID_SWT=C:\Users\someone\AppData\Local\Android\sdk\tools\lib\x86_64\swt.jar

@baoti
Copy link

baoti commented Jan 21, 2019

This is my local monkeyrunner.bat, it works for me:

rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0

rem Check we have a valid Java.exe in the path.
set java_exe=
call ..\lib\find_java.bat
if not defined java_exe goto :EOF

if defined APP_HOME goto AppHomeOk
    set APP_HOME=%ANDROID_HOME%\tools

:AppHomeOk

for /f %%a in ("%APP_HOME%\lib\monkeyrunner-26.0.0-dev.jar") do set jarfile=%%~nxa
set frameworkdir=.
set libdir=

if exist %frameworkdir%\%jarfile% goto JarFileOk
    set frameworkdir=..\lib

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

:JarFileOk

set jarpath=%frameworkdir%\%jarfile%

if not defined ANDROID_SWT goto QueryArch
    set swt_path=%ANDROID_SWT%
    goto SwtDone

:QueryArch

    for /f "delims=" %%a in ('%frameworkdir%\..\bin\archquery') do set swt_path=%frameworkdir%\%%a

:SwtDone

if exist "%swt_path%" goto SetPath
    echo SWT folder '%swt_path%' does not exist.
    echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
    exit /B

:SetPath

call "%java_exe%" -Xmx512m "-Djava.ext.dirs=%frameworkdir%;%swt_path%" -Dcom.android.monkeyrunner.bindir=%ANDROID_HOME%\platform-tools -jar %jarpath% %*

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants