QA Engineering/End to End Test

adb shell 을 사용한 Batch script 만들기

일해라폴폴 2019. 11. 23. 22:55
반응형

기존에 테스트를 진행 할때 기본 정보들 이나,

혹은 Logcat등을 따로 저장 하는 것도 귀찮아 하는 팀원들이 많아서

 

주말 근무를 이용해

메뉴 선택 후 확인 하는 Script를 만들어 봄

 

또 막상 쓸 것 같지는 않지만 그래도 내가 떠나면 알려줄 사람도 (아직은) 없고

그렇다고 열심히 공부하는 팀원들도 없어서...

 

어쨋거나 간단히 batch로 만들었고,

실행하면 대충 이런 느낌으로 사용할수 있음

 

Figure. 이러하다...

아래는 대충 script

(내가 까먹을까봐 ㅋ)

@echo off
rem make by Byoungow Jeoung
rem create on Nov.23.2019
rem Anyone can be updated when new functions implement.
Title BTI FVT NJ Team Test Program :D

echo ____________________________________________
echo Now connecting the device access
echo Please wait...
echo ____________________________________________

adb kill-server
adb start-server

echo ____________________________________________
echo 1. Get A Test Information
echo 2. Start Bootup log
echo 3. Setup Wizard SKIP (only ENG mode)
echo 4. Screen Recording
echo 5. Device Reboot
echo 6. I am keyboard
echo 0. Exit
echo ____________________________________________

set /p code= Please input the Number:_

if %code%==1 GOTO 1
if %code%==2 GOTO 2
if %code%==3 GOTO 3
if %code%==4 GOTO 4
if %code%==5 GOTO 5
if %code%==6 GOTO 6
if %code%==0 GOTO exit

:1 
echo ____________________________________________
echo ::::: BVT Test Information :::::
echo ____________________________________________
echo Android Version (ex.POS, QOS)
adb shell getprop ro.build.version.release
echo ____________________________________________
echo Test CSC Sales Code
adb shell getprop ro.csc.sales_code	

echo ____________________________________________
echo Test Carrier ID
adb shell getprop ro.boot.carrierid

echo ____________________________________________
echo Device Memory Information
adb shell cat proc/meminfo

echo ____________________________________________
echo Device File size
adb shell df -h

echo ____________________________________________
echo ### ?Are you want Exit? ###

pause
exit

:2 
cd c:\
echo ____________________________________________
echo Now Log is gathering...
echo Save Location: "c:\BVT_Error_bootupLog.log"
echo If you finish the bootlog, Please click the Ctrl c butoon and terminated the batch job (Yes)

adb logcat -b main -b radio -b system -v threadtime > BVT_Error_bootupLog.log

pause
exit

:3 
echo ____________________________________________
echo Now, system starts the skip process...
echo This Menu allowed only ENG binary

adb remount
adb shell pm disable com.google.android.setupwizard
adb shell pm disable com.sec.android.app.SecSetupWizard
adb shell settings put global device_provisioned 1
adb shell settings put secure user_setup_complete 1
adb shell setprop persist.sys.setupwizard FINISH

pause
exit

:4
echo ____________________________________________
echo Now Screen Recording...
echo Save Location: /sdcard/Download)
echo If you stop the Recording, Please click the Ctrl c butoon and terminated the batch job (Yes)

adb shell screenrecord /sdcard/Download/BTI_FVT_NJ_ScreenRecording.mp4

pause
exit

:5
echo ____________________________________________
echo Are you really reboot the device?
echo If you press the any key, device will be restart...
pause

adb reboot

pause
exit

:6
echo ____________________________________________
set /p text=Please intput text(only allowed English, ex.login or password):

pause

adb shell input text %text%

pause
exit

끗!

반응형

'QA Engineering > End to End Test' 카테고리의 다른 글

wireshark RTP parsing  (0) 2020.01.22
adb shell 을 사용한 Batch script 만들기 -season2-  (0) 2019.12.13
ADB Install Failure Case 해결  (0) 2019.11.21
About APN  (0) 2018.11.20
IMS, QXDM 때문에 이것저것...  (0) 2018.11.11