How do I obtain crash-data from my Android application?

前端 未结 30 2529
庸人自扰
庸人自扰 2020-11-22 01:10

How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance

30条回答
  •  旧巷少年郎
    2020-11-22 01:30

    This is very brute, but it is possible to run logcat anywhere, so a quick and dirty hack is to add to any catch block getRuntime().exec("logcat >> /sdcard/logcat.log");

提交回复
热议问题