Search code examples
androidxamarin.androidvisual-studio-debuggingvisual-studio-2022maui

Debugging MAUI app on Android after manual launch


I have a MAUI app on Android which works perfectly when launched from Visual Studio with the debugger attached. If I published an APK and install it on the device manually, the application crashes as soon as I use the AppShell to change the current page.

How can I attach the debugger to it after I've launched it manually? Failing that, just finding a way to see a stack trace for the unhandled exception would be a big step forward.

I tried capturing a bug report and reproducing the crash, but the report did not appear to contain any account of crash. I was unable to find any crash dump logged by the OS, but this is my first Android app, so I might be missing something there.


Solution

  • Thank you @jan-joneš, you set me along the right path. Although it's outdated with respect to MAUI, I found a useful page in the Xamarin documentation with more tips.

    It would be so much easier if these exceptions were flagged by the debugger!