1#!/bin/bash 2 3# The files to save output to. 4RAWLOGS_FILE=power-toggle-rawlogs.txt 5ANALYSIS_FILE=power-toggle-analysis.txt 6 7 8# Turn on the screen and unlock the device 9# TODO: Power on 10adb shell wm dismiss-keyguard 11adb 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 & 16analyze_pid=$! 17 18sleep 5 19for 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 26done 27 28# Kill adb to disconnect logcat 29adb kill-server 30 31# Wait for the pyton process to exit 32wait $analyze_pid 33 34echo "Wrote raw logs to $RAWLOGS_FILE" 35echo "Wrote analysis to $ANALYSIS_FILE" 36 37 38