We are now testing our application with a few friends. Sometimes there are some errors which don't throw an exception. So I don't really know whats the problem was. So I thought it would be a good idea to implement a menu item which allows to send the logcat output to a e-mail address, so that we can examine the log.
Unfortunately I didn't find a hint in the Internet how to extract the logcat from a phone. How to send an email shouldn't be the problem.
Tap the ellipses, and select “send” to email the log as an attached text file along with general device information. That's it! Your Logcat has been successfully captured and sent to Professor Oak.
adb logcat –d > filename.txt This command will extract the logcat information from the connected device and redirects the output to a file on the PC. The option –d will take care that the output will stop when all output is flushed.
The Log class Log is a logging class that you can utilize in your code to print out messages to the LogCat. Common logging methods include: v(String, String) (verbose) d(String, String) (debug)
Look at android-log-collector, as it does what you are trying to do.
It is not possible to collect arbitrary LogCat data as of Android 4.1. There was never a documented and supported way of doing that, and the undocumented/unsupported way was locked down in Jelly Bean. For your own crashes, you are better served using a crash logging library, like ACRA.
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