diff options
author | Guang Zhu <guangzhu@google.com> | 2011-07-08 11:21:58 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2011-07-11 12:32:08 -0700 |
commit | 42f4377581f58a9520ba86563202f5aeaff1ba6b (patch) | |
tree | 513ac56a71025f0eef4d1f8808da7c09549514fd | |
parent | dba332410528d11474ae9f878b6984755d55e299 (diff) | |
download | extras-42f4377581f58a9520ba86563202f5aeaff1ba6b.tar.gz |
script for capturing and mailing bugreport
Change-Id: Ie6b25393bfd61be54dc6b58b81bffbc2d26b40f5
-rwxr-xr-x | bugmailer/bugmailer.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bugmailer/bugmailer.sh b/bugmailer/bugmailer.sh new file mode 100755 index 00000000..c8da909e --- /dev/null +++ b/bugmailer/bugmailer.sh @@ -0,0 +1,21 @@ +#!/system/bin/sh + +timestamp=`date +'%Y-%m-%d-%H-%M-%S'` +storagePath="$EXTERNAL_STORAGE/bugreports" +bugreport=$storagePath/bugreport-$timestamp +buildDesc="`/system/bin/getprop ro.build.description` +(Sent from BugMailer)" + +# run bugreport +/system/bin/dumpstate -o $bugreport $@ + + +# make files readable +chown root.sdcard_rw $bugreport.txt + +# send intent to mail it +/system/bin/am start -a android.intent.action.SEND \ + -t "application/octet-stream" \ + -e "subject" "bugreport-$timestamp" \ + -e "body" "$buildDesc" \ + --eu "android.intent.extra.STREAM" "file://$bugreport.txt" |