MonoDroid: Global Error Handler

后端 未结 3 731
你的背包
你的背包 2020-12-21 04:53

Is there a way to create a global error handler for MonoDroid? My debugger is broken so I need a way to see the exception info while the application crashes.

相关标签:
3条回答
  • 2020-12-21 05:22

    Please look at my project, it can handle and submit error info. https://github.com/soundnRg/Crasher

    0 讨论(0)
  • 2020-12-21 05:29

    Most (all?) unhandled exceptions should end up in the Android debug log:

    http://docs.xamarin.com/android/advanced_topics/android_debug_log

    0 讨论(0)
  • 2020-12-21 05:30

    It seems that AndroidEnvironment.UnhandledExceptionRaiser is what you're looking for:

    //that's a dirty-code example, do not use as-is! :)
    AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
                    {
                        File.AppendAllText("tmp.txt", args.Exception.ToString());
                    };
    
    0 讨论(0)
提交回复
热议问题