1 #!/bin/bash 2 3 # The files to save output to. 4 RAWLOGS_FILE=power-toggle-rawlogs.txt 5 ANALYSIS_FILE=power-toggle-analysis.txt 6 7 8 # Turn on the screen and unlock the device 9 # TODO: Power on 10 adb shell wm dismiss-keyguard 11 adb logcat -P "" 12 13 # Start the analysis process 14 $TOP/development/tools/logblame/analyze_logs.py --duration=10m --clear --rawlogs $RAWLOGS_FILE \ 15 | tee $ANALYSIS_FILE & 16 analyze_pid=$! 17 18 sleep 5 19 for i in {0..5..1}; do 20 adb shell input keyevent KEYCODE_POWER 21 sleep 5 22 adb shell input keyevent KEYCODE_POWER 23 sleep 5 24 adb shell wm dismiss-keyguard 25 sleep 5 26 done 27 28 # Kill adb to disconnect logcat 29 adb kill-server 30 31 # Wait for the pyton process to exit 32 wait $analyze_pid 33 34 echo "Wrote raw logs to $RAWLOGS_FILE" 35 echo "Wrote analysis to $ANALYSIS_FILE" 36 37 38