Android has, from ICS onwards (I think) provided the ability for a user to capture the system state, and then send or share the captured data with whomever they wish. See What does it mean with bug report captured in android tablet?
The captured data includes a screenshot, list of running processes, Logcat contents, active threads for each process, etc.
This is fantastically useful, but triggering it seems to involve the user pressing funny key combinations (Power + VolumeUp + VolumeDown) or enabling Developer mode and choosing specific options from there (Take bug report, Power menu bug reports).
Is there a way I can trigger this from my own code, so that I can offer my users a simple menu option to capture a bug report?
Android bug report The purpose is to get information such as “device logs, stack traces, and other diagnostic information to help you find and fix bugs in your app.” With this function, you can capture bugs directly from devices, emulators, or adb's.
Bug reporting can now be added to the list of improved areas. As before, you can report a bug from the developer options settings menu or with the power button shortcut if you enable it. Now, you should be able to view reports you've made via the Files app on your Pixel phone.
Sometimes when an app is installed or updated, some erros show up. Some of them can be easily fixed following the steps below on your Android settings: Search for the option Apps & Notifications, then App info, search for Kyte, tap on storage & memory.
Reading up on the link that you have posted - What does it mean with bug report captured in android tablet?
The [answer] marked as correct says bugmailer.sh
in the system/bin
does the reporting.
So, in theory if you could detect an app crash using any of these methods, then you could execute your own copy of bugmailer.sh
in the sdcard and get a report.
Source for bugmailer.sh
: https://android.googlesource.com/platform/system/extras/+/android-4.2.2_r1/bugmailer/bugmailer.sh
However, you will realize that this will obviously work only for rooted phones as you read the source.
The easier way would be to open the Developer options
and have a system overlay window pointing at what they should click. This would be the only user friendly solution for non rooted phones.
You can open the Developer options
using
startActivity(new Intent(
Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
For further reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With