美文网首页
Adb push bat脚本

Adb push bat脚本

作者: MrDecoder | 来源:发表于2021-01-21 18:48 被阅读0次

以下脚本可以用于在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

相关文章

网友评论

      本文标题:Adb push bat脚本

      本文链接:https://www.haomeiwen.com/subject/knpdzktx.html