2016-09-29 104 views
-1

當您通過cmd運行多個腳本時,它們將按順序執行。同時運行2個腳本monkeyrunner

如何同時運行它們?

MONKEYRUNNER但

@echo off 
rem Copyright (C) 2010 The Android Open Source Project 
rem 
rem Licensed under the Apache License, Version 2.0 (the "License"); 
rem you may not use this file except in compliance with the License. 
rem You may obtain a copy of the License at 
rem 
rem  http://www.apache.org/licenses/LICENSE-2.0 
rem 
rem Unless required by applicable law or agreed to in writing, software 
rem distributed under the License is distributed on an "AS IS" BASIS, 
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
rem See the License for the specific language governing permissions and 
rem limitations under the License. 

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 

set jarfile=monkeyrunner.jar 
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 ('"%java_exe%" -jar %frameworkdir%\archquery.jar') 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=..\framework -jar %jarpath% %* 
+0

'設置java_exe =調用的lib \ find_java.bat'設置變量字串'調用的lib \ find_java.bat' - 我認爲這不是你想要的。使用'for/f'來獲取命令或批處理文件的輸出。回答你的問題:'start /?'是你需要的。 – Stephan

+0

我的代碼:啓動monkeyrunner c:\ 9 \ 1.py啓動monkeyrunner c:\ 9 \ 13.py,但它們啓動執行輪流的java.exe。沒有立即完成2,我需要同時運行 –

回答

0

如何是一個小例子,充滿了垃圾。

Start "" Program1 
Start "" Program2 
+0

我的代碼: 開始monkeyrunner c:\ 9 \ 1.py 啓動monkeyrunner c:\ 9 \ 13.py 但他們啓動java.exe執行轉動。不會立即完成2 –

+1

您需要準確指定編輯問題時發生的情況。我不明白你的簡短迴應。 – 2016-09-29 08:42:24