以下脚本可以用于在Windows上执行adb push file批量操作,将脚本文件放置于目标文件夹,脚本会遍历文件夹拷贝除自身外的所有文件。
:: This is a batch script for batch adb push file processing.
:: Using @prefix to close the whole echo line
@ECHO off
ECHO Start batch adb pushing...
adb devices
:: Try capture ouput by command 'adb devices' to get serial number of devices
:: Handle multipe devices condition.
:: TBD
:: Set Destination
SET REMOTE=/storage/emulated/0/Download
:: Get current file name(e.g cpy_file.bat)
SET CURRENT_FILE=%~n0%~x0
::ECHO %CURRENT_FILE%
:: Set counter
SET total=0;
for %%f in (*) do (
:: Print all
ECHO %%f
:: Skip current bat file.
if "%%f"=="%CURRENT_FILE%" (
ECHO %CURRENT_FILE% filtered out.
)else (
SET /a total+=1
adb push %%f %REMOTE%
)
)
@ECHO:
ECHO Batch adb push file end,with %total% files total.
::adb shell
::cd %REMOTE%
::ls
PAUSE
网友评论