22

I followed steps in this post and tried to connect to my Motorola X Gen 2 for Wifi debugging, on OS X El Cap.

I connected my phone to the laptop with usb cable, I killed and started server, the server was started successfully, and then in:

./adb devices

I got

List of devices attached
TA44909GA0  device

Then I did

./adb tcpip 5555

And I tried

./adb connect <IP addr of my phone>:5555

both with usb cable connected and disconnected, none of them worked. Both returned error message saying:

unable to connect to ***.***.***.***:5555: Operation timed out

I cannot figure out what is happening here, I tried the Android Studio plugin ADB WIFI, which returned the same message, operation timed out. I restarted everything, tried connecting with a different cable and all, nothing worked.

Does anyone know what's happening here?

Community
  • 1
  • 1
TPWang
  • 1,322
  • 4
  • 20
  • 39
  • 1
    make sure that `AP isolation` is off on your wifi router – Alex P. Dec 31 '15 at 21:21
  • I don't think that's the problem, it worked once, just once, the day before, and the next day it went back to "operation timed out". (And I am using my school wifi, so probably the setting didn't change) – TPWang Dec 31 '15 at 21:24
  • Any solution to this? – shiladitya Jan 06 '16 at 16:19
  • Not net. Restarting ./adb and phone and wait for a couple of hours would get it to work for a while. I'm suspecting it's hardware problem. Probably not good for this site... – TPWang Jan 06 '16 at 17:42
  • 2
    Really, "adb reboot" (will restart your device) worked for me. – Shamm Jan 18 '16 at 06:58
  • Make sure you are not in any VPN network – Tim Aug 01 '16 at 03:08
  • Doesn't work for me. Same network, not on VPN, restarted adb, restarted phone, still nothing. I'm not sure about AP isolation, but I'll live with the intermittent usb for now and focus on the app – AA_PV Dec 23 '16 at 14:52
  • @AA_PV It's better not to use it with a router that has a firewall itself, e.g. those ones that you need admin password to log in. – TPWang Dec 23 '16 at 15:32

6 Answers6

17

Make sure your computer and the android device are using the same wifi network. I had the same issue and fixed it after changing to the same wifi.

Theebi Iyer
  • 206
  • 2
  • 5
  • This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/14659138) – R. Zagórski Dec 21 '16 at 08:40
  • 4
    @R.Zagórski this seems like an answer *"your computer and the android device needs to use the same wifi network"* – Petter Friberg Dec 21 '16 at 09:01
5

So after a huge number of trials, I think the problem is somehow wifi related, I think this feature does not work well with WPA2 (or any kind of?) Enterprise encryption, because I was using my school Wifi, and it turned out to be okay, up and running, for the hotspot I set up with another laptop.

TPWang
  • 1,322
  • 4
  • 20
  • 39
  • 1
    same thing happened to me.. my machine and device were connected to different wifi routers in my home.. =) =P – AweSIM Dec 20 '16 at 20:18
  • I have one router at home and both my MBP and FireTV are connected to the same SSID, but I could neither ping the IP or connect via adb. When I had both connect to my mobile hotspot, it worked fine. – haridsv Apr 24 '21 at 10:14
4

What solved this for me:

  • disconnect the phone from USB cable
  • restart the phone
  • reconnect the phone by USB cable

(meanwhile):

  • adb kill-server
  • adb start-server

Then follow the "standard" procedure.

user3581248
  • 964
  • 10
  • 22
2

If you are connected on same network and still can't connect then check your IP twice . Sometimes it get changed. check your IP = phone settings -> About phone -> Status -> IP address

1

Try increasing the timeout in Android Device Monitor.

From Android Studio: Tools->Android->Android Device Monitor In Android Device Monitor: Window->Preferences, Android->DDMS.

In the DDMS window, increase the "ADB Connection Timeout (ms)". It defaults to 5000ms. If your app is particularly large/takes a long time to load, it may go longer than this timeout, so increasing may fix it.

Keithel
  • 253
  • 2
  • 12
1

If you are using Mac OS.

Check by clicking on the wifi icon in the toolbar. If there is any warning.

In my case there was a warning saying the wifi is using WPA protocol and its not secure.

I went to my router settings and changes the protocol to WPA2/WPA3 auto.

After that the warning went away and the wireless debugging started working.