如何从我的Android应用程序中获得崩溃数据(至少堆栈跟踪)?至少在我自己的设备上工作时可以通过电缆检索,但理想的情况是,从我的应用程序在野外运行的任何实例中都可以,这样我就可以改进它,使它更可靠。


当前回答

If your app is being downloaded by other people and crashing on remote devices, you may want to look into an Android error reporting library (referenced in this SO post). If it's just on your own local device, you can use LogCat. Even if the device wasn't connected to a host machine when the crash occurred, connected the device and issuing an adb logcat command will download the entire logcat history (at least to the extent that it is buffered which is usually a loooot of log data, it's just not infinite). Do either of those options answer your question? If not can you attempt to clarify what you're looking for a bit more?

其他回答

在Android 2.2中,现在可以从Android市场应用程序中自动获得崩溃报告:

Android的新错误报告功能 市场应用让开发者能够做到这一点 接收崩溃和冻结报告 他们的用户。报告将会 当他们登录到他们的 出版商账户。

http://developer.android.com/sdk/android-2.2-highlights.html

你可以试试ACRA (Android应用程序崩溃报告)库:

ACRA是一个库,使Android应用程序自动张贴他们的崩溃报告到GoogleDoc的形式。它是针对android应用程序开发人员,帮助他们从他们的应用程序崩溃或行为错误时获取数据。

它很容易安装在你的应用程序中,高度可配置,不需要你在任何地方托管服务器脚本…报告被发送到谷歌文档电子表格!

我还找到了一个更好的web应用程序来跟踪错误报告。

https://mint.splunk.com/

配置步骤少。

使用上面的链接登录或注册并配置。一旦你创建了一个应用程序,他们将提供如下所示的一行来配置。

Mint initAndStartSession (YourActivity。这“api_key”);

在应用程序的build.gradl中添加以下内容。

android { ... 存储库{ Maven {url "https://mint.splunk.com/gradle/"} } ... } 依赖关系{ ... 编译”com.splunk.mint:薄荷:4.4.0” ... }

添加上面复制的代码,并将其添加到每个活动中。 Mint.initAndStartSession (YourActivity。这个,”api_key”);

就是这样。你登录并进入应用程序仪表板,你会得到所有的错误报告。

希望它能帮助到别人。

If your app is being downloaded by other people and crashing on remote devices, you may want to look into an Android error reporting library (referenced in this SO post). If it's just on your own local device, you can use LogCat. Even if the device wasn't connected to a host machine when the crash occurred, connected the device and issuing an adb logcat command will download the entire logcat history (at least to the extent that it is buffered which is usually a loooot of log data, it's just not infinite). Do either of those options answer your question? If not can you attempt to clarify what you're looking for a bit more?

We use our home-grown system inside the company and it serves us very well. It's an android library that send crash reports to server and server that receives reports and makes some analytics. Server groups exceptions by exception name, stacktrace, message. It helps to identify most critical issues that need to be fixed. Our service is in public beta now so everyone can try it. You can create account at http://watchcat.co or you can just take a look how it works using demo access http://watchcat.co/reports/index.php?demo.