Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with adb.exe - AdbHostServer.cpp:93: Unable to connect to adb daemon on port: 5037

I have a problem with adb.exe of Android Studio 3.4.

When I run the emulator, I get this error:

Emulator: emulator: ERROR: AdbHostServer.cpp:93: Unable to connect to adb daemon on port: 5037

I opened a terminal with the rute of the adb.exe: C:\Users\Christian\AppData\Local\Android\Sdk\platform-tools

And here I tried with adb kill-server and then adb start-server and I get this:

*daemon not running; starting now at tcp:5037
*daemon started successfully

When i run again the same error appears, i get this in terminal with the command adb devices:

List of devices attached
emulator-5554   offline

I emulate Nexus 5X API 28 with System Image: Pie 28 x86 Android 9.0.

I download the last version of abd.exe in for Windows

I also reinstalled the Android Studio and the emulator, but the error still appears.

How can I solve that?

like image 906
Christian_bvb09 Avatar asked May 18 '19 10:05

Christian_bvb09


People also ask

How do you fix Cannot reach adb server attempting to reconnect?

This could be some configuration problem with you android studio try to delete your . android file in your users folder and restart android studio(proceed with caution). first try with android emulator, make sure to keep your android sdk up to date. give some to android studio in first initialization.

How do I fix my adb exe has stopped working?

Can you try to restart the adb server via Tools -> Android -> Restart Adb Server? It might be worth updating the Android platform-tools on your computer manually using the SDK manager to the latest version. You might have an old version of adb that is failing in some way.

Why does it say unable to locate adb?

As it turns out, the error message appears when Android Studio is not able to locate the ADB.exe file that is located in the platform-tools folder. This can happen due to several reasons including when your antivirus software removes the adb.exe file due to a false alarm.


2 Answers

You need to first run adb start-server and then run emulator -avd <avd_name>

like image 153
Uddhav P. Gautam Avatar answered Oct 18 '22 03:10

Uddhav P. Gautam


I had this happen with the following Event Log entry:

Emulator: emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037

So I opened command prompt as administrator and ran netstat -a -b >c:\connections.txt and found the following:

 [Amazon Music Helper.exe]
  TCP    127.0.0.1:5037         jbiss-PC:0             LISTENING
 [adb.exe]
  TCP    127.0.0.1:5037         jbiss-PC:54858         ESTABLISHED
.
.
.
[ss_conn_service.exe]
  TCP    127.0.0.1:51146        jbiss-PC:5037          CLOSE_WAIT
.
.
.
 [adb.exe]
  TCP    127.0.0.1:54858        jbiss-PC:5037          ESTABLISHED

So I shut down Amazon Music Helper, shut down and restarted Android Studio and then launched the emulator. It works now. I'm not sure why I started having this problem today, I assume that Amazon Music Helper was involved previously and the status indicated ESTABLISHED for adb.exe, but I did, and this process cleared it up for now at least.

like image 2
Jeff Avatar answered Oct 18 '22 03:10

Jeff