Last active
December 23, 2020 14:16
-
-
Save andreyfomenkov/18b0b69037371e6aa71132ab32a7b0ce to your computer and use it in GitHub Desktop.
Shell script to send broadcast event, pull report and display in a browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Replace APPLICATION_ID, REPORT_DEVICE_LOCATION | |
# and REPORT_DESKTOP_LOCATION with your values | |
BROADCAST_ACTION="build-rx-report" # Intent filter action for BroadcastReceiver | |
APPLICATION_ID=com.myapplication # RENAME | |
SLEEP_BEFORE_PULL=3 # Give a time (in seconds) to generate & save HTML report | |
# Location in Android device SD card | |
REPORT_DEVICE_LOCATION=/storage/emulated/0/Android/data/$APPLICATION_ID/files/report.html | |
REPORT_DESKTOP_LOCATION=~/report.html # Location on desktop | |
adb shell am broadcast -a $BROADCAST_ACTION | |
sleep $SLEEP_BEFORE_PULL | |
adb pull $REPORT_DEVICE_LOCATION $REPORT_DESKTOP_LOCATION | |
adb shell rm $REPORT_DEVICE_LOCATION | |
open $REPORT_DESKTOP_LOCATION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment