Find which TTY device connected over USB
I am doing android development. The adb ppp command to switch back to the USB cable instead of tcp/ip says it needs the tty as a parameter.
I have googled for this and found lots of references to solutions that don't work. A lot of those point to ttyUSB0, which doesn't seem to exist on my system.
I am running Ubuntu Desktop 12.04. How can I find my tty for my android phone?
Thanks.
Here is a quick method . After plugging in USB cable, you just issue:
dmesg | grep tty
This will output the tty devices detected by kernel, in the order that they were detected and with a time stamp.
Store list of devices before pluging in Android
ls /dev/ > dev_list_1.txt
Then run this after you plug it
ls /dev/ | diff --suppress-common-lines -y - dev_list_1.txt
The result should be something like this:
libmtp-2-1.2 <
sdb <
serial <
sg2 <
ttyACM0 <
Or even monitor for change
while sleep 1 ; do clear ; ls /dev/ | diff --suppress-common-lines -y dev_list_1.txt ; done