Problems with adb.exe

落花浮王杯 提交于 2020-06-11 18:41:40

问题


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?


回答1:


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.




回答2:


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




回答3:


If you have any port utilizing software like Xampp, Vmware workstation, or virtual box they normally utilize the port through which the Android Studio can access the devices. Therefore,

  1. On your Android Studio interface click on Assistant
  2. It will show you Troubleshoot your connection
  3. click on next until you see Restart ADB Server
  4. do that until it restarts.



回答4:


I had this with flutter. I updated Flutter and Dart to latest version and it resolved.




回答5:


Close emulator and then Cold Boot that virtual device. And then try again. Here is the link to catchup how to Cold Boot emulator.




回答6:


  1. Check JAVA_HOME, NODE_HOME and ANDROID_HOME paths in environment variables. If they are not available, set them.

  2. Cold Boot your emulator.

  3. Kill appium server session if it is running. Then re-run the appium server

  4. Run your program through IDE



来源:https://stackoverflow.com/questions/56198290/problems-with-adb-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!