0

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

Nancy
  • 315
  • 1
  • 5
  • 16

1 Answers1

0

I'm also developing an app that acts as a USB Host to an Arduino board.

For debug, I'm using Logcat app (https://play.google.com/store/apps/details?id=com.tananaev.logcat&hl=en&gl=US). This allows you to view the Logcat logs on your Android phone.

You need to follow the directions in the app description:

Connect your phone via USB cable and run following adb command:

adb tcpip 5555

Disconnect USB cable before trying to use the app.

You can filter the logcat results by keyword or tag, and/or search for a keyword. I've found it very useful.

If this doesn't work for you, I've seen that there are other similar apps that you can try.

Danielle
  • 38
  • 9