指定logcatArguments时,我没有收到LOGCAT。
我用下面的代码
@ReportsCrashes(mailTo = Constants.MAIL_TO,
logcatArguments = { "-t", "500", "-v", "long", "ActivityManager:I", "*:D", "*:S" },
customReportContent = {
ReportField.BUILD, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE,
ReportField.USER_EMAIL, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION,
ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE,
ReportField.LOGCAT,
},
mode = ReportingInteractionMode.DIALOG, resToastText = R.string.crash_toast_text,
resDialogText = R.string.crash_dialog_text, resDialogIcon = android.R.drawable.ic_dialog_info,
resDialogTitle = R.string.crash_dialog_title,
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
resDialogOkToast = R.string.crash_dialog_ok_toast, logcatFilterByPid = true)
我试过了
logcatArguments = {以及“” -t“,” 500“,”-v“,” long“},但LOGCAT仍然为空。但是,如果我不指定logcatArguements,则会得到几行日志。我至少需要获取他的Logcat的最后500行,而不进行任何过滤。有人可以帮助我进行配置。
最佳答案
我只是在应用程序文件中初始化ACRA,它会给出完整的logcat错误。
@ReportsCrashes(formKey = "1sCVh3QRentB2aK-2lqbjtt92RwFBxEtM2MbOaB9ErRc", mailTo = "your mail", mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text)
public class MyApplication extends Application {
@Override
public void onCreate() {
// The following line triggers the initialization of ACRA
ACRA.init(this);
super.onCreate();
}
}
希望对您有所帮助。