开发者

Android How to verify successful installation of ACRA crash logging

I followed the instruc开发者_StackOverflow社区tions for adding ACRA to my project as follows:

http://code.google.com/p/acra/wiki/BasicSetup

Aside from waiting for a crash, how can I verify I set up everything properly? Is there a way to get it to log some sort of success message? Or do I have to purposely put in an error that will cause it to crash?


Throw a RuntimeException.

throw new RuntimeException("Dying on purpose");

Instances of RuntimeException (and its subclasses) are unchecked, so the compiler won't complain.


Just do int i = 10/0; in constructor. :D


If you just want to get a copy of the report you can do the following.... ACRA.getErrorReporter().handleSilentException(null);


Add this to your app startup code:

throw new Exception("ACRA is alive!");


Actually, the best way to prove everything's set up properly is to generate an error to see if the report was indeed sent to you. ACRA is invented for sending crash logs, so you should test it on a crash. Just comment out some line of code to make your application crash, that's all. Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜