1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to debug USB OTG application?

Discussion in 'Android Development' started by andrey2211, Jun 27, 2020.

  1. andrey2211

    andrey2211 Lurker
    Thread Starter

    I am working on an Android application which talks to external device via USB. How can I debug such an app?

    Is it possible for virtual device to use real USB in OTG mode and connect to external device?

    How do I wire real phone for debugging? I need my PC to be USB host for USB debugging right? So if PC is connected to phone USB port is busy. Is it possible to wire real phone to be USB host for external device while having PC debugging the app?

    dontpanicbobby likes this.

    1. Download the Forums for Android™ app!


  2. The adb command has a tcpip mode. I've used it and it works, but when I plug the USB OTG device in I stop getting logcat output. Maybe I'm doing it wrong, but maybe you can figure it out.

    Code (Text):
    1. (base) puff@rockyraccoon:~/$ adb devices
    2. List of devices attached
    3. 015629628541c1c8    device
    5. (base) puff@rockyraccoon:~/$ adb tcpip 5555
    6. restarting in TCP mode port: 5555
    7. (base) puff@rockyraccoon:~/$ adb connect
    8. connected to
    9. (base) puff@rockyraccoon:~/$ adb devices
    10. List of devices attached
    11.    device
    12. 015629628541c1c8    device

Share This Page