Skip to content

Instantly share code, notes, and snippets.

@luongvo
Forked from thebagchi/ADB+.BAT
Created June 8, 2016 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luongvo/47f128305035ae49eafef08f19c4fcd6 to your computer and use it in GitHub Desktop.
Save luongvo/47f128305035ae49eafef08f19c4fcd6 to your computer and use it in GitHub Desktop.
script for issuing commands to multiple android devices on windows
:: Inspired by Linux version of the same https://gist.github.com/christopherperry/3208109
@echo off
SET ARGUMENTS=%~1
if "%ARGUMENTS%" == "" (
GOTO EOF
)
SET "ARGUMENTS=%ARGUMENTS:""="%"
SETLOCAL ENABLEDELAYEDEXPANSION
:: INSTALL ON ALL ATTACHED DEVICES ::
FOR /F "tokens=1,2 skip=1" %%A IN ('adb devices') DO (
SET IS_DEV=%%B
if "!IS_DEV!" == "device" (
SET SERIAL=%%A
echo "adb -s !SERIAL! %ARGUMENTS%"
call adb -s !SERIAL! %ARGUMENTS%
)
)
ENDLOCAL
:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment