Home | History | Annotate | Download | only in logblame
      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..10..1}; do
     20     adb shell input keyevent KEYCODE_POWER
     21     sleep 5
     22     adb shell wm dismiss-keyguard
     23     sleep 5
     24 done
     25 
     26 # Kill adb to disconnect logcat
     27 adb kill-server
     28 
     29 # Wait for the pyton process to exit
     30 wait $analyze_pid
     31 
     32 echo "Wrote raw logs to $RAWLOGS_FILE"
     33 echo "Wrote analysis to $ANALYSIS_FILE"
     34 
     35 
     36