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
set a=0
for /f "skip=1 tokens=1,2,3,4,5" %%i IN (source.txt) do (
set "FILE_INPUT=%%i"
set "FILE_SAVE_RESULT=%%j"
set "DATA_REFER_LOCAL=%%k"
set "DATA_REFER_REMOTE=%%l"
set "TEST_RESULT=%%m"

if "!a!"=="0" del !TEST_RESULT!
set a=1
adb -s 20080411 remount
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 exit>>tmp.txt
adb -s 20080411 shell<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

adb -s 20080411 pull !FILE_SAVE_RESULT!  !DATA_REFER_REMOTE!
echo TEST "!FILE_INPUT!" RESULT: >>!TEST_RESULT!
fc !DATA_REFER_LOCAL! !DATA_REFER_REMOTE! >> !TEST_RESULT!
)
endlocal
pause
exit 0


 

posted @ 2017-05-03 16:10  liuzhipenglove  阅读(2296)  评论(0编辑  收藏  举报