首页 > 代码库 > bat 处理adb脚本

bat 处理adb脚本

@echo off
REM Funtion: 测试parsermode 接口CdxParserGetMediaInfo 和CdxParserRead
REM Code by lzp 2017-05-02 [email=liuzhipeng@allwinnertech.com]
cls
title pasertest

:MediaInfo
color 0A
echo 	.
echo	= = = = = = = = = = = = = = = = = = = = = =
echo	Please select the type of source, and enter
echo	= = = = = = = = = = = = = = = = = = = = = =
echo	.	
echo	1.	Diff Pack
echo	.
echo	2.	Diff Code
echo	.
echo	3.	Diff Ratio
echo	.
echo	4.	MultiSub
echo	.
echo	5.	MultiSound
echo	.
echo	6.	Other

:Start
set select=
echo	.
set /p select=		please select Type:
IF NOT "%select%"=="" set select=%select:~0,1%
if /i "%select%"=="1" goto PACK
if /i "%select%"=="2" goto CODE
if /i "%select%"=="3" goto RATIO
if /i "%select%"=="4" goto MULTISUB
if /i "%select%"=="5" goto MultiSound
if /i "%select%"=="6" goto OTHER
echo Type is invalid, Please Reenter!
echo .
goto Start

:PACK
cd /d D:\parsertest\source\pack
goto TEST
:CODE
cd /d D:\parsertest\source\code
goto TEST
:RATIO
cd /d D:\parsertest\source\ratio
goto TEST
:MULTISUB
cd /d D:\parsertest\source\mutilsub
goto TEST

:TEST
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2,3,4,5,6" %%i IN (source.txt) do (
set "FILE_INPUT=%%i"
set "FILE_SAVE_RESULT=%%j"
set "DATA_REFER_LOCAL=%%k"
set "REMOTE_SAVE_REFER_PATH=%%l"
set "REMOTE_DATA_REFER=%%m"
set "FILE_TEST_RESULT=%%n"

echo	.
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	1.	delete mediaInfo.dat
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	.
echo rm -rf !FILE_SAVE_RESULT!>tmp.txt
echo exit>>tmp.txt
adb -s 20080411 shell<tmp.txt
ping -n 1 127.0.0.1>null
echo	.
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	2.	Test CdxParserGetMediaInfo And CdxParserRead
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	.
echo /system/bin/paserdemo -n 1 -i !FILE_INPUT! -me !FILE_SAVE_RESULT! >tmp.txt
echo /system/bin/paserdemo -n 2 -i !FILE_INPUT! -md !FILE_SAVE_RESULT! >>tmp.txt
echo exit>>tmp.txt
adb -s 20080411 shell<tmp.txt
ping -n 5 127.0.0.1>null
echo	.
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	3.	push local refer data to remote(android) 
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	.
adb -s 20080411 push  !DATA_REFER_LOCAL!  !REMOTE_SAVE_REFER_PATH!
ping -n 5 127.0.0.1>null
echo	.
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	4.	cmp interface out(stream and mediaInfo)
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo !REMOTE_DATA_REFER!
echo /system/bin/md5cmp  !REMOTE_DATA_REFER!   !FILE_SAVE_RESULT! >tmp.txt
echo /system/bin/rm -rf !REMOTE_DATA_REFER! >>tmp.txt
echo exit>>tmp.txt
adb -s 20080411 shell<tmp.txt
ping -n 3 127.0.0.1>null
echo	.
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	5.	pull result to local(windows)
echo	= = = = = = = = = = = = = = = = = = = = = = = = = = =
echo	.
adb -s 20080411 pull /data/camera/md5CmpResult.txt  C:move /Y C:\md5CmpResult.txt  !FILE_TEST_RESULT!
del tmp.txt
ping -n 3 127.0.0.1>null
)
endlocal
pause
exit 0


 

bat 处理adb脚本