Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I have two devices connected to my workstation simultaneously, one by usb, the other over wifi.

C:\>adb devices
List of devices attached
Cxxxxxxxxxx2            device
192.168.60.69:5555      device

I'm not sure how to shell into the wifi connected device while the usb one is present.

I've tried the following

C:\>adb shell
error: more than one device and emulator

C:\>adb -s 192.168.60.69 shell
error: device not found

C:\>adb -s 0xxxxxxxxxxxxxx1 shell
error: device not found

where 0xxxxxxxxxxxxxx1 is hardware id of wifi connected device

Only way that works is to disconnect the usb connected device. However, I'm going to eventually have multiple wifi connected devices, I still don't know how to distinguish between them when trying to shell in?

Edit (6/13/2014)

I see why I was omitting the port, b/c the connect command returns the following error when trying to connect and cannot (say for instance the devices wifi was accidentally turned off)

C:\>adb connect 192.168.60.69:5555
unable to connect to 192.168.60.69:5555:5555

This made me think that adb would append port based on ip. However this is not the case, since after wifi was enabled on the target device, the above command did work

C:\>adb connect 192.168.60.69:5555
connected to 192.168.60.69:5555

I needed to mention something to show that I atleast know tcp/ip connect fundamentals (ip and port). Kinda embarrassing...

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You need to include the port number.

adb -s 192.168.60.69:5555 shell

If you're using a sensible shell with configurable tab-completion (i.e. not Windows), then you can type adb -sTab to get a list of devices.

share|improve this answer
    
That is a slick trick. Thanks. –  Samus Arin Jun 12 at 16:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.