I've developed an Android 2.2 application.
My client has it and he said me that there is a crash that I can't reproduce.
To log errors I'm using android.util.Log; and ex.printStackTrace(); on every handled exception.
Is there a log about that error on device? How can I get those logs?
I could say my client to connect his device to PC and tell him where to look for those logs; copy them to his PC and send me by e-mail. Is it possible?
For the current case, you can ask your client to install any log reading app from Google Play, like this one, and asking him to save the log during the crash and send them to you. Or if the client has asking to a computer with the SDK etc. setup on it, then you can ask him to execute adb logcat -d > logcat.txt. This will save the logcat in the file logcat.txt, which can then be mailed to you.
For future cases, I recommend that you integrate a project like ACRA, which can automatically send you crash reports, along with information like device, stacktrace etc.
Related
I have a situation. My client says they are facing some issue (not a crash) while using the app. We have tried all our ways that could help fixing it. But nothing works out. The best we can do is to travel to client's location- Connect the device to a PC and the debug the issue while inspecting the entire logs. Can all this be avoided? Any app that the client can install and send us the entire logs of app running.
Is it possible to see the logcat of an app that is on a distant device, in short, is it possible to logcat remotely?
I sent an app to a client, this is giving error in your device, I tested with the emulator in the same version, but the error only occurred with it.
Is it possible to see the logcat of an app that is on a distant
device, in short, is it possible to logcat remotely?
It is possible to connect device over wifi to perform debugging. You can refer to this document. However, it has limitation that both the device and the host needs to be connected to common wifi.
Since your device is in customer premises and cannot be under common wifi, there is no other way to perform remote debugging.
Alternatives:
1. For logical Errors
The best alternative would be to store logs in local directory (Internal storage or SdCard) and ask your customer to send these logs. You can use libraries like logback-android which facilitates this functionality at ease. You just need to perform some configuration.
2. For crash
You can integrate some crash analytics like Hockey app which will notify the crash along with the related stacktrace. If you want detailed information about pre-condition then you have to go for Alternative 1.
I'm looking for something like ACRA (Automated Crash Reporting for Android) https://github.com/ACRA/acra but it has to be able to store data, and send it once the user goes online.
Already read through suggestions on
How do I obtain crash-data from my Android application?
but none of these says something about offline solutions. Anybody knows a solution that works offline and that I could use with my AWS account or a linux domestic server (raspberry pi)?
You should use Crashlytics
Marc from Crashlytics here. If the app crashes without an active network connection, the report will still be caught! We always send crash reports on launch when there's an active connection. If that fails, we'll queue it to send later. :)
https://stackoverflow.com/a/18618098/1048340
I'm still fairly new to Android coding. I've made lots of use of the Log.d() function in my code to display lots of handy logging messages to the logcat console within the Android Studio environment, when I run the app with the device connected to the computer (or on an emulator).
Now I'd like to be able to get debug information from a user when the app is running on their device, hopefully showing the same Log.d() messages that I see in the logcat console within Android Studio.
I've done some searching but can't seem to find a straightforward guide as to how this is achieved.
Thanks.
You have to use a web server. First send the content of logd() to your server and then check them on your server. However, you may want to test your own apps instead of asking users to test. Google developer console has a place to show some debug information if your app crashed when users are using them.
You can use a webserver, file-backed logger, or any other way of saving/submitting data on the fly.
Most people will recommend either some form of integrated web service like HockeyApp, etc., but you can get it done just by sending a plain old text file if needed. FYI, not best practice, but it gets the job done.
My android application works well in my phone. I sent it to my friend and it crashes on my friend's phone, but I can't get the error logs.
Is it able to deploy my application direct to my friend's phone via internet? That I can see the error messages via logcat.
ACRA may help you here. It would allow you to gather the error reports from remote users of your application.