summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2011-07-08 11:21:58 -0700
committerGuang Zhu <guangzhu@google.com>2011-07-11 12:32:08 -0700
commit42f4377581f58a9520ba86563202f5aeaff1ba6b (patch)
tree513ac56a71025f0eef4d1f8808da7c09549514fd
parentdba332410528d11474ae9f878b6984755d55e299 (diff)
downloadextras-42f4377581f58a9520ba86563202f5aeaff1ba6b.tar.gz
script for capturing and mailing bugreport
Change-Id: Ie6b25393bfd61be54dc6b58b81bffbc2d26b40f5
-rwxr-xr-xbugmailer/bugmailer.sh21
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"