0

I am connecting my Android Phone with my Linux Ubuntu Laptop over Micro USB(Android) to USB(Laptop) cable for Development/Debugging using Android Studio.
Will it possible to open the USB Port as Serial Communication port for sending and receiving data to/from Phone and Linux?
I wan to implement Java based test application on Linux which will talk with Android App over Serial.

I was trying to list the device when phone is connected using $ ls /dev/ttyUSB* but I did not find it listed under /dev.

How can I use USB as serial on Linux for Serial communication with Android Device?
Do I need to have USB serial converter cable something like:

(Android) Micro USB<--->Serial Male = Serial Female<-->USB (Linux)

Or can it be possible using Virtual Com Port, how?
Thanks for the help, highly appreciated.

User7723337
  • 11,857
  • 27
  • 101
  • 182
  • The Android device could be setup as the USB slave with a gadget serial device driver. The PC as USB host would have a **/dev/ttyACM**n device node. – sawdust Jul 03 '20 at 17:07
  • Not sure what you mean by the gadget serial device driver. Is it some drivers provided by Android sdk? Can you post link to example. – User7723337 Jul 03 '20 at 17:43
  • https://www.kernel.org/doc/Documentation/usb/gadget_serial.txt or https://android.googlesource.com/kernel/common/+/android-trusty-3.10/Documentation/usb/gadget_serial.txt – sawdust Jul 03 '20 at 18:37
  • @sawdust Thanks for the links, do I need to rebuild the Linux kernel to set my Ubuntu as USB slave device. When I plugin my Android I don't see `/dev/ttyACMn` or even `/dev/ttyUSBn`. I cloud see the mobile listed under the `lsusb` command. But no tty to open and connect. – User7723337 Jul 06 '20 at 10:20

0 Answers0