Android 如何使用adb push填写SD卡

Android 如何使用adb push填写SD卡,android,batch-file,copy,push,adb,Android,Batch File,Copy,Push,Adb,我需要填写SD卡(可用空间为0kb),因此,我正在使用以下批复制SD卡上不同名称的文件“Maroon.file”(25mb)(Maroon_1.file,Maroon_2.file,…) 当SD卡没有更多的内存来复制任何其他文件时,adb push会给出这样一条消息“未能将'Maroon.file'复制到'/sdcard/Download/Maroon_4.file':设备上没有剩余空间””,我正试图用findstr命令捕捉该消息,该命令按“失败”搜索,我已经测试了该命令(findstr),运行

我需要填写SD卡(可用空间为0kb),因此,我正在使用以下批复制SD卡上不同名称的文件“Maroon.file”(25mb)(Maroon_1.file,Maroon_2.file,…)


当SD卡没有更多的内存来复制任何其他文件时,
adb push
会给出这样一条消息“
未能将'Maroon.file'复制到'/sdcard/Download/Maroon_4.file':设备上没有剩余空间”
”,我正试图用
findstr
命令捕捉该消息,该命令按“
失败
”搜索,我已经测试了该命令(
findstr
),运行良好,但是使用
adb push
命令它不工作。有人有其他想法吗?

我不确定我是否确实得到了你需要的东西;grep命令如何?

即使通过管道发送到findstr,错误消息是否仍会显示? 如果是这样,那么错误可能被写入stderr(2)流,而不是stdout(1)流。将此流重定向添加到您的命令<代码>2>&1

adb push Maroon.file/sdcard/Download/Maroon_u%counter%.file
<2>&1

set counter=0
:COPYSMALLFILES
set /a counter=%counter% + 1
adb push Maroon.file /sdcard/Download/Maroon_%counter%.file | findstr /L "failed" |  findstr /C:"failed to" 
echo %errorlevel%
if %errorlevel%==1 (
    GOTO COPYSMALLFILES
)