开发者

Android How to verify successful installation of ACRA crash logging

开发者 https://www.devze.com 2023-04-06 03:37 出处:网络
I followed the instruc开发者_StackOverflow社区tions for adding ACRA to my project as follows: http://code.google.com/p/acra/wiki/BasicSetup

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

精彩评论

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