Reputation: 31
Is there a way of running ADB commands parallely on multiple connected Android devices? I need to batch install set of 5 applications on 200 devices. ADB seems to be the fastest option. However if I can do this parallely on multiple devices, then it will further save the time.
Upvotes: 3
Views: 2528
Reputation: 1
Thanks to Alex.P, The Badak.
In my case, Add
recursive start with input value and serialno
and, set ANDROID_SERIAL=serialno
in 2nd Start
Start cmd
can run several android devices in parallel.
And If you added adb.exe
folder-path to System Environment path, you cannot consider cmd start address.
The following is the code:
@echo off
setlocal EnableDelayedExpansion
if "%1"=="" (
FOR /F "tokens=1,2" %%a IN ('adb devices') DO (
IF "%%b" == "device" ( set devicesn=%%a )
start %0 !devicesn!
)
) else (
set ANDROID_SERIAL=%1
REM WRITE YOUR SCRIPT BELOW
REM ------------------------
)
Upvotes: 0
Reputation: 2030
create a batch_install.bat
file with the following content:
@echo off
cls
FOR /F "tokens=1,2" %%a IN ('adb.exe devices') DO (
IF "%%b" == "device" ( start /b adb.exe -s %%a install -r %1 )
)
Now you can run batch_install.bat <apk_file>
to install the apk_file
on to all connected devices.
Upvotes: 5