Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Logcat output of an App to an EmailAdress

Tags:

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.

like image 397
RoflcoptrException Avatar asked May 17 '10 19:05

RoflcoptrException


People also ask

How do I send Logcat?

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.

How do I export from Logcat?

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.

Which class do we use to send some output to Logcat?

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)


1 Answers

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.

like image 171
CommonsWare Avatar answered Oct 20 '22 15:10

CommonsWare