NFC固件更新自动化压力测试脚本

@echo off

if {%1}=={} goto Usage
if {%2}=={} goto Usage

set times=0

echo ---------------------Start NFC Firmware Update-----------------------

:UPDATE_8.1.11
echo ############################8.1.11 update############################
set /a times+=1
echo Upate 8.1.11 times:%times%
echo Push libpn547_fw.8.1.11.so into /system/vendor/firmware/libpn547_fw.so
::adb remount
ping -n 2 127.1>nul
::adb push libpn547_fw.8.1.11.so /system/vendor/firmware/libpn547_fw.so
ping -n 2 127.1>nul
::adb reboot
echo total times:%times% > totaltimes.txt
ping -n %1 127.1>nul
echo get adb log, check FW update state
::adb shell dmesg > dmesg.txt
ping -n 3 127.1>nul
type dmesg.txt |findstr "FW Version"
if %ERRORLEVEL%==0 (
	echo Update FW to 8.1.11 success
)
if %ERRORLEVEL%==1 (
	echo Update FW to 8.1.11 fail
	goto UPDATE_FAIL
)

:UPDATE_8.1.12
echo ############################8.1.12 update############################
set /a times+=1
echo Upate 8.1.12 times:%times%
echo Push libpn547_fw.8.1.12.so into /system/vendor/firmware/libpn547_fw.so
::adb remount
ping -n 2 127.1>nul
::adb push libpn547_fw.8.1.12.so /system/vendor/firmware/libpn547_fw.so
ping -n 2 127.1>nul
::adb reboot
echo total times:%times% > totaltimes.txt
ping -n %1 127.1>nul
echo get adb log, check FW update state
::adb shell dmesg > dmesg.txt
ping -n 3 127.1>nul
type dmesg.txt |findstr "FW Version"
if %ERRORLEVEL%==0 (
	echo Update FW to 8.1.12 success
)
if %ERRORLEVEL%==1 (
	echo Update FW to 8.1.12 fail
	goto UPDATE_FAIL
)
goto UPDATE_8.1.11

:UPDATE_FAIL:
echo Start to getLog
call .\wait.bat
ping -n %2 127.1>nul
echo Update Time:%times% fail >> updateFail.txt
goto UPDATE_8.1.11

:Usage
	echo Usage:NFC_updateFW_autoTest.bat rebootTime getLogTime
pause

你可能感兴趣的:(windows技术)