Android app to generate bugreport - android

Occasionally users of our Android app is run into an obscure problem in the Google infrastructure that Google is trying to track down. And naturally the Engineer working on it wants to see some bugreport output when this happens. Which brings us down to the old problem of how do I get a non-techie end user to generated and send in a bugreport. Installing the SDK, configuring for a Windows system so that can do an
adb bugreport
doesn't sound feasible.
I've been looking around for a simple app that will do this, with no success. So I tried adding that capability to my own app. And this is where I need help. If I use the shell command to access my device, I can generate reports with something simple as
sh -c 'bugreport | gzip > bugreport.gz'
But if I try to execute this from my app, bugreport just displays an error message
Failed to connect to dumpstate service
I'm guessing that I am missing some odd permission, but have no idea what it might be.
Anyone have any ideas what I can try?

If I am not wrong, you want to see the error log when the application is crashed. For this you can integrate ACRA library with the code. This can generate the runtime uncaught errors and that can be sent to email or specific server.

The "shell" user has permission to do things that apps don't, so you can't simply run bugreport from an app.
On Android 4.2 and later you can take a bug report from the Developer Options menu. The menu can be enabled by going into Settings, selecting About Phone, and tapping on Build Number seven times. (This is documented here, under On-device Developer Options.)
The generated bug report can be sent through e-mail (watch for a notification to appear). In some circumstances it's less useful than "adb bugreport" would be, since you have to switch to Settings to generate the report, but it will have the full logs and other goodies. There's a magic key sequence that will initiate bugreports, but I don't know if there's a way to enable it on non-dev devices.

Android now has the ability to capture a bug report at will. To quote from an android issue comment by a project member:
First enable bug report shortcuts:
navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’.
When you have run across a bug:
To take bug report, hold the power button and select the ‘Take bug report’ option.
That will generate a zip archive and offer to share it, e.g. via email, upload to Google drive or whatever. But note that the bugreport zip file contains a bunch of information that may be considered private, so users should only share it with folks they trust to use it appropriately. And of course also note that the developer of an app probably already can access some or all of that information. The ChkBugReport tool gives insights into what is reported. But I haven't seen a good security/privacy writeup (or really any official documentation on all this) so I advise appropriate caution.

Related

Android informations to report on a bug report

I want to add a Bug Report/Report Problem option to my app, which sends device and app info and a user's comment to the developer. I was wondering if there are any "standard" things to report? I am reporting OS Version, Device Name and App Version. Is there anything important I'm missing out and should include? What are you guys normally including ?
You could avoid sending out this data manually by integrating with a service like Instabug
which allows the user to report bugs through your preferred method, but mainly through shaking the device.
It will display a screenshot of the current view that the user can draw on for visual bug identification. What gets reported along is (but not only) the following:
App version
Device type
OS version
Location
CPU load
Memory usage
Storage
Connectivity
Battery
Orientation
Network and console logs
Visual reproduction steps
UI view hierarchy inspection
users can further describe the bug using text, extra screenshots, voice notes, or screen recordings.
All reports arrive in your Instabug dashboard containing various details such as:
Network and console logs
Complete Device details
Reproduction steps
Crash stack trace (In case of a crash report)
It only takes a line of code to integrate.
For full disclosure, I work at Instabug. Let me know if I can help.
Check out the free service
http://www.crashlytics.com/
you can get the features what is mentioned above.

How to get android log from the users for Android 4.1 without rooting?

Starting Android 4.1 gettings android log requires ROOT permission, so now it's impossible to
ask users to send log using apps like LogCollector, which just get android log and send it to email. Android log can be viewed using ddms app from Android SDK but it's not good to ask users install Android SDK.
So, how to get android log from the users for Android 4.1 without rooting?
You can get your own app's log without permission now. You can not read other apps' logs at all, permission or not.
This is somewhat documented here. Just refer to Diane Hackborn's response:
The change is that third party applications can no longer get the read
logs permission, however every app can read the logs containing only
the lines they have written, without needing any permission.
Keep in mind that access to the logs has never been part of the SDK,
and is still not part of the SDK. If you are relying on it then, even
after this change, you run the risk of breaking in the future. (And
that is partly why this got lost for documentation, it is not part of
the SDK, so there isn't really a place to document it, in fact
documenting it would kind-of make it a part of the SDK which we don't
want. :p)
There are quite a few handy libraries out there that send the Crash Reports across to you.
ACRA
Zubhium How it works
Bug Sense
Acra is open source and free. Zubhium and Bug Sense have have a limited functionality Free Version.
All being said, these are good ONLY for your own application. Everything else that does not belong to you, is basically, off limits.
I am not sure if this could / would work, but see the Source for Cyanogenmod. There might be something of use and interesting there.

Where do Crash Reports on Android go in Developer console

I have been working on an android project and published it to the market. I then installed the app on my device via the play store and upon doing something I found a possible way to crash the app.
When the app force closed it asked me if I wanted to send a report which I did so I could see what it looks like in the developer console.
I added some text about what I did to cause the app to force close and could then view what the crash report looked like and it conained various information like device make and model etc. I submitted and I logged in to my developer account but could not see any of the information within the crash report other than the message I put inside explaining what I did.
Where does the rest of the information go as unless someone actually says what phone or android version they are running in the message I don't what I need to replicate the issue.
Thanks for any help you can provide.
AFAIK, you cannot view the device etc. in the developer console. You can only view the user message (if provided) or the stack trace. Beyond that there is no more information as far as I know.
However, you can get much more information by integrating ACRA into your application. This will give you a huge amount of information about the crash, including memory statistics, the device, the android version it is running etc.
EDIT
It would seem that the device at least is displayed in the new Developer Console, but the information still isn't even close to what ACRA provides.
With the standard report included it depends a bit on android(?) or play store app version what details you get in your reports it seems. In the publisher/developer console (example from the new developer console version):

Android debugging

since the latest version of my Android application I got some bug reports (via email) that my application doesn't work anymore. It does not crash but doesn't work anymore. Only a few users (<0.05%) have this problem. I don't see any similarities (same phone/provider/...).
Has anyone an idea how I can tackle this problem and find the bug?
If I publish a debug version of the application, is there any tool that the end-user can use to grab the logcat output and send it per email or...
Thanks!
My suggestion is that you incorporate a logging feature on your app, even the retail one. Make a log of critical/fatal errors, but try to minimize the log size (e.g. erasing it periodically or only logging really really critical errors). This way you can request such logs for such users, without having them install a new version of the app, and having them to recreate the erros, since sometimes recreating the whole situation in which such crashes occur is close to impossible, or that it doesn't happen for some other reason in a debug version.
You can also incorporate a function that sends you the log periodically, or just request it to the users.
I don't know any tool other than ADK to grab the logcat...
One of the best debugging tool available is the ACRA library.
Below are few links, which will help you to use this library.
1) http://code.google.com/p/acra/downloads/detail?name=acra-4.2.3.zip&can=2&q=
2)http://code.google.com/p/acra/wiki/BasicSetup
Let me know if you are stuck somewhere.

How to instruct users to report a bug in Android

How do you instruct users to report a bug in Android? Any advice or tips?
I'd like to get send detailed instructions to my users to get the most of their bug report. I know there are various apps that send bug reports from the device and I was wondering how other Android developers deal with this.
A bug reporting SDK such as Instabug can let you achieve that.
As you can see, it displays, by default, a welcome message to your users 10 seconds after opening the app. It displays instructions on how to invoke Instabug depending on the invocation method you're using (A button or a shake gesture).
After signing up and including the library in your code, you can switch between different display messages. Use either of the following lines depending on whether you're in beta or production.
Instabug.setWelcomeMessageState(WelcomeMessage.State.BETA);
Instabug.setWelcomeMessageState(WelcomeMessage.State.LIVE);
Each bug report contains various information about device details, network logs, console logs, view hierarchy inspection, and visual reproduction steps.
For full disclosure, I work at Instabug. Let me know if I can help.
There are solutions for instrumenting the application in a way that will collect contextual information and allow the user to provide in-app feedback. Either by shaking the phone or some other trigger like a menu option.
Here is a "currently free" offering from IBM called Mobile Quality Assurance, that will instrument the application so that as a user uses the application contextual information is collected as they use the app. When they want to provide feedback or submit a bug, they can shake the phone and it will capture the screen at the time, give them a form to enter additional information and then submit the screenshot, contextual information and comments to the testing portal.
Here's a link for more info on MQA
Taking Gilbert's advice into account, I decided to create my own app. I hereby present you: Bug Reporter.
It allows users to send you a report with device information and optional logcat. It also supports intent extras to customize its behavior if case you want to launch it from your app.
You can do what google does with their new maps application on iPhone. When you're using the app and shake the phone (which users do when they're frustrated or something isn't working) you can pop up a screen that asks if something is wrong and is a form for bug submission that they can choose to fill out.
This isn't Android specific, but you could have a bug reporting screen in your application that sends the information your customers type, along with any system information you wish to capture, to your web server. Alternatively, the application could email you with the information.
There are some libraries you can integrate to do this job, you don't need to develop a solution yourself. For example, I'm using blit feedback. With this library you can take snapshots, draw on them and add some comments. I've configured it to send reports by email, but if you have an issue tracker you can connect it too.
Discovered this question a lot late. There are answers given but the products mentioned or the techniques are quite old now. Adding the tool that we have been working on - Bugclipper
This tool let's your users report issues from with-in the app Android or iOS and you can add/annotate screenshots, create screen recordings with voice and also get the crash logs.
p.s. - I am one of the co-founders.

Categories

Resources