Gustavo Piucco
Gustavo Piucco

Reputation: 557

Android adb hangs in list devices and other commands

When I try to run adb commands from terminal, especially adb devices, adb kill-server and adb start-server it hangs and I need to type CTRL+C to exit proccess. Its not possible to deploy APK to physical or virtual devices. Something is block adb proccess/port. I have anti-virus uninstalled and firewall disabled.

In the example below, I type adb devices and terminal show me List of devices attached and hangs in there.

enter image description here

Upvotes: 12

Views: 21381

Answers (8)

Tashinga Bwanali
Tashinga Bwanali

Reputation: 1

i recently started having this problem too out of nowhere my adb commands are hanging and i cant use any device to debug.The only fix i have found so far is to kill all processes on port 5037 but there must be a 1 stop solution once and for all

Upvotes: 0

Sion C
Sion C

Reputation: 451

SOLVED! Windows 10. TURN ON YOUR FIREWALL FOR DOMAIN AND PRIVATE AND PUBLIC.

something must be trying on the network to connect to this port. after doing so the issue just gone with even no rebbot.

it is been a week already I am stugglind with this pc. where I have 10 PCs each with 150 devices.

Upvotes: 0

Belcookies
Belcookies

Reputation: 33

What ended up working for me was killing the server and then restarting it.

It takes a little bit of time but has worked for everytime.

Kill command adb kill-server¨

Start command adb start-server

The kill command will take a minut or so but it will work.

after that you can run your other adb commands

Upvotes: 1

Kream
Kream

Reputation: 131

just like @par said and to kill the processes, just look at their PID number and to kill them you use "taskkill /PID (their pid) /f" and put the PID number there, /f is for force kill

Upvotes: 0

Jeb Dude
Jeb Dude

Reputation: 1

Apart from checking for updated USB drivers...

In Windows, I've experienced hangs when using a USB hub with a harddrive, and/or other input devices attached. With my particular hardware setup, either my USB hardware is crappy, (maybe my latest USB hub is crappy) or the USB drivers for the USB controller are crappy, or I'm just running into what may be some more-or-less natural limitations to USB on the Windows platform (in regards to android hardware on Windows anyway).

EDIT: I'm particularly referencing USB3 here. I also happen to have a USB3 non-powered hub plugged into a USB2 port -- that port connects my mouse, an HDD, and my android device -- I've since had to re-think what is plugged where to ensure adb works properly.

One last helpful Windows tip, if you haven't restarted in days or weeks, might be a good idea to just restart and start fresh, and of course, Windows Updates (usually not a hindrance to how my android hardware works). Doing this can take care of another application using port 5037 (as mentioned by @par above).

I also experience issues when I try to batch several "adb pull" commands in sequence. I have been working on a setup to selectively pull a list of folders that aren't nested and thus can't be pulled in only one command that I know of (part of my custom backup solution). I sometimes find I have to pull one folder at a time. This is more likely related to my USB issues, and not so much and adb issue.

EDIT: Depending on what version of Win10 you use, you might have to manually initiate the update-check for your drivers, through the Device Manager. I actually managed to get an Android driver update by doing this recently. So far that update, and rethinking what is plugged where, things are working slightly better lately.

Upvotes: 0

par
par

Reputation: 191

adb binds to TCP port 5037, if this port is in use by different process you might see that any adb commands would just hang and wont do anything.

  • Use "netstat -aon | more" commands to figure out which process is on port 5037
  • kill the process that is on 5037 and your adb commands should start working

Upvotes: 19

son_yalas10
son_yalas10

Reputation: 11

Something similar happened to me, I didn't have Android drivers correctly installed. You need to install Google USB Driver and then:

  1. Go to Control Panel Home

  2. Click on the "Device Manager" link.

  3. In the Device Manager locate your Android device (other devices). Then right-click on it and select "Update Driver Software".
  4. Select "Browse my computer for driver software".
  5. Select "Let me pick from a list of device drivers on my computer".
  6. Select "Show All Devices".
  7. Press the "Have Disk" button.
  8. Enter the path to the Google USB driver. Normally it is located in the following directory: C:\Program Files (x86)\Android\android-sdk\extras\google\usb_driver
  9. Select "Android ADB Interface" from the list of device types.
  10. Confirm the installation of the driver by pressing "Yes". And install it.

Complete tutorial here: http://visualgdb.com/KB/usbdebug-manual/ Hope it works!

Upvotes: 1

sonnv1368
sonnv1368

Reputation: 1597

Try to:

Step1: Open android studio.
Step2: Choose Android device monitor.
Step3: At the device window: choose triangle icon then choose reset adb. (Try to repeat 2-3 times if it is not show some devices)

Upvotes: 0

Related Questions