Send Logcat output of an App to an EmailAdress

前端 未结 7 1945
难免孤独
难免孤独 2020-12-01 15:56

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 t

相关标签:
7条回答
  • 2020-12-01 16:42

    I would also look into Flurry (flurry.com) which not only gives you general analytics but allows you to log arbitrary info and also logs uncaught exceptions for you. I set it up in literally 5 minutes, but one thing to keep in mind is that it's not real-time like an email alert. You'll have to wait a few hours for what you log in your app to show up on their dashboard. It could also be overkill if you have a really lightweight app, but I've noticed no performance loss in my app as a result of using the service.

    0 讨论(0)
  • 2020-12-01 16:44

    This solution doesn't send an email, but sends it to a server through UDP.

    https://github.com/Chemik/logcatudp

    The source code is available. It can be easily embedded in our own app. I haven't tried to do so.

    0 讨论(0)
  • 2020-12-01 16:46

    I found the LogCollector very usefull indeed (the tip from CommonsWare):

    And don't forget to set in your own application:

    <uses-permission android:name="android.permission.READ_LOGS" />
    
    0 讨论(0)
  • 2020-12-01 16:50

    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.

    0 讨论(0)
  • 2020-12-01 16:51

    Thanks to you 2 but by browsing the android-log-collector forum I found a solution that is even easier to handle:

    There you can store a php file somewhere on your server (or if you dont want to use your own server, they also have a script on their server). In this php file you can define what shall be done when the post message reaches the server. I just definded a very simple code which forwards the data to my mail adress.

    This only works if an uncaught exception was thrown. But one could extend the default uncaught exception handler, so that it's also possible to not only get the stacktrace but also the logcat.

    0 讨论(0)
  • 2020-12-01 16:56

    I'd definitely recommend to look also at this project here

    0 讨论(0)
提交回复
热议问题