summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2011-07-11 16:45:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-11 16:45:41 -0700
commit9690ca9c16d9435d2a384ad996513e2b5ee1f778 (patch)
tree395a247acea16503a3881da13196b1bc65cd8ea6
parentfda77ea946fa4c58775d5ff63895cf9d41d3b568 (diff)
parent42f4377581f58a9520ba86563202f5aeaff1ba6b (diff)
downloadextras-9690ca9c16d9435d2a384ad996513e2b5ee1f778.tar.gz
Merge "script for capturing and mailing bugreport"
-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"