43

My adb is down, no matter I am using ADT or Android Studio.

And according to the second answer of this SO question, I did:

  1. I type:

    adb nodaemon server
    

    Output:

    cannot bind 'tcp:5037'
    
  2. Then netstat -ano | findstr 5037

    I did find a pid of 7416 who listen in 127.0.0.1:5037

  3. I use taskkill /pid 7416 -f to kill it.

  4. I type netstat -ano | findstr 5037 again, I found another pid listens at 127.0.0.1:5037 again!

I guess they are the same, but I have no idea who it is.

Can I simply have a easy way to release this port or change the adb port to another one?

Community
  • 1
  • 1
JaskeyLam
  • 14,373
  • 17
  • 110
  • 142
  • Have you tried tasklist|findstr 5037 to find the name of the program at 5037? – Spencer Oct 03 '14 at 14:37
  • What program is listening? Is it an adb or something else? If it's a one-time issue rebooting may work, otherwise you may have to figure out what is claiming that port. In theory ADB could be patched to utilize a different one. – Chris Stratton Oct 03 '14 at 15:51
  • @ChrisStratton , I found that program!! And I kill it and stop it from booting, which solves this problem now. – JaskeyLam Oct 03 '14 at 16:16
  • I'm facing similar kind of issue can any one suggest me why this is happening – Aman Systematix Feb 16 '17 at 11:29
  • I think you might help this answer. Try this https://stackoverflow.com/a/47150042/6917362 – E J Chathuranga Nov 07 '17 at 04:37

13 Answers13

62

In my case I was trying to use genymotion emulator device. With genymotion opened and running, I've tried to run my app in this emulator but I it doesn't worth

In this part I had this error:

'C:\Users\Jose\AppData\Local\Android\sdk\platform-tools\adb.exe,start-server' failed -- run manually if necessary

Then I've tried Jaskey's solution but it doesn't works.

So I stopped genymotion emulator. Then I restart ADB (Tools > Android > Unchecked Unable ADB Integration then I've checked again)

Next I've start genymotion emulator again And now the app works on the emulator.

José Mercado
  • 649
  • 1
  • 5
  • 3
53

For Windows,

Close Android Studio and any of your Emulators you are using,

then goto->TaskManager and Kill the process(adb.exe)

After finishing all these First open Android studio followed by emulators.

Shangeeth Sivan
  • 1,750
  • 19
  • 19
46

Sometimes there are conflicts between ADB Genymotion and ADB SDK because both of them use the same port. So I recommend always set up ADB Genymotion to use the ADB SDK, in that way to avoid incompatible issues.

Genymotion-> Settings -> ADB -> Use custom Android SDK tools (here your set up your sdk android location).enter image description here

yaircarreno
  • 3,772
  • 34
  • 31
24

I solve this problem at last! I finally found the program name of the pid and I kill it in the task manager.

The way to detect is described in the question:

  1. adb nodaemon server

Output:

cannot bind 'tcp:5037'

2.and then netstat -ano | findstr 5037 to find who takes this port.

Get the pid and find it in the task manager. Please note that the process tab may not show the column of pid, we should include it by setting.

In my case, it is tfadb.exe who takes this port! This is a Chinese Video program client! Try to kill it in task manager.

Now I stop it starting from booting. The problem is solved.

JaskeyLam
  • 14,373
  • 17
  • 110
  • 142
  • Does the fact that it has "adb" in its name and uses port 5037 mean it's a tool for video on top of the ADB capability of an Android device? Or is it purely coincidence? – Chris Stratton Oct 03 '14 at 16:21
  • @ChrisStratton , I Think it is just a terrible coincidence! This is an program for windows not for android. – JaskeyLam Oct 03 '14 at 16:25
  • You may be able to change the port that program uses, or you can change the one ADB uses, either with an environment variable, or in recent versions a command line option: http://stackoverflow.com/questions/3836571/changing-default-port-i-e-5037-on-which-adb-server-runs – Chris Stratton Oct 03 '14 at 16:29
  • THANK YOU!!!!!!!!!!!!! Literally tried solving this for 3 hours. – Bruce Bruce Sep 06 '21 at 21:18
7

Close Android studio then go to Task Manager

  • End Task adb.exe
  • goto Details menu
    • End Task java.exe and jusched.exe

now open Android Studio it will work properly

7

The best and working solution is:

  1. Close Android Studio
  2. Open task manager
  3. Kill the process adb.exe
  4. Open android studio again
  5. Problem solved
Ali Zahid
  • 89
  • 1
  • 9
6

I solved by End task "adb.exe" background process from task manager. and Start adb thats it :)

KamDroid
  • 102
  • 4
  • 7
5

Open the Genymotion emulator after opening The Android studio.

4

in my case one application on window use adb.exe.

that application name is mobogenie.

Fixed :: Goto Window TaskManager select adb.exe and press End process

4

Just goto the task manager on your PC, and kill adb.exe, then back to your android studio. it should initialize and reconnect.

John Fash
  • 317
  • 3
  • 6
  • 3
    While this is an answer, it's a "copy" of a previous answer (https://stackoverflow.com/a/38920749/4283581). There is no additional value for SO to keep two answers with the same solution. – Grant Miller Jun 23 '18 at 03:37
1

disconnect any usb connected android devices. I was tethering to my laptop via my cellphone for internet connection. I got the adb start server failed error with loopback error "port is only used for one socket connection".

I disconnected my cellphone usb connection from my laptop and now android studio recognizes my genymotion emulator and another android device I have connected via usb in the deployment target box.

0

if genymotion or emulator not working try to install pdanet+ in your system and mobile device choose your mobile type(motorola,sony,other)it will automatically install driver and run your application in mobile device.

0

Check the firewall of the system. May be the "allow app to communicate through windows firewall" may have blocked android studio.