I am developing an android app to communicate to a drone using MAVLINK. I am using UsbSerial by felHR85 and dronefleet libraries for this. After building and installing the app, I use my phone as an Android USB host and connect a PixHawk microcontroller to it.
When I run the app on my phone with PixHawk attached, I have no method to know why my app crashes (if it does crash). I just get the "App keeps stopping" error message. I cannot view the log messages via Logcat since I'm not connected to my PC. The serial port library developer has given the idea of debugging over WiFi but I do majority of my work in my office where I use Ethernet LAN, not WiFi.
Without the app crash stacktrace, I cannot move further. So how do I debug my app, specifically app crashes?
Details: Android Studio Arctic Fox
Ubuntu 18 LTS
Java programming language
Samsung android phone with Android 11