Android - could not install *smartsocket* listener

2019-02-12 04:52发布

When I try run my Android application I get this exception:

Error while waiting for device: java.lang.RuntimeException: Unable to create Debug Bridge: Unable to start adb server: error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: An attempt was made to access a socket in a way forbidden by its access permissions. (10013) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon 'C:\Users\XXX\AppData\Local\Android\Sdk\platform-tools\adb.exe,start-server' failed -- run manually if necessary

So I try do it manualy with these commands:

adb kill-server

  • response: * server not running *

adb start-server

  • response was next exception:

*daemon not running. starting it now on port 5037 * error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: An attempt was made to access a socket in a way forbidden by its access permissions. (10013) could not read ok from ADB Server

*failed to start daemon * error: cannot connect to daemon

I looking for adb process in my task manager but not running. Any ideas? Thanks.

5条回答
我想做一个坏孩纸
2楼-- · 2019-02-12 05:09

I solved this for myself by simply closing the shell I'd been running adb commands in and starting a new one, inspired by Vinayak Mestri's answer.

查看更多
贪生不怕死
3楼-- · 2019-02-12 05:17

Restarting adb server uns an External terminal (CMD) did the job for me:

Android-SDK/platform-tools/adb.exe kill-server
Android-SDK/platform-tools/adb.exe start-server
查看更多
倾城 Initia
4楼-- · 2019-02-12 05:20

Open command prompt and enter following command

netstat -ano | findstr :5037

This will show procees id

TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 832

832 is procees id

Now run command

tasklist | findstr processID (e.g tasklist | findstr 832)

It will show process name like bash.exe

just go to task manager and end the task bash.exe and use following command to start adb

adb start-server

voillllaaaaaaa........

查看更多
等我变得足够好
5楼-- · 2019-02-12 05:25

If you have the situation where this keeps happening and killing and restarting still doesn't work it may be a problem with your adb installation. I had to reinstall adb to resolve this problem:

  1. Reboot to ensure no instances of adb is running
  2. Launch SDK Manager in Android Studio: Tools->Android->SDK Manager
  3. Select the SDK Tools tab
  4. Deselect Android SDK Platform-Tools item
  5. Hit Apply
  6. Check the on screen logs to make sure the un-installation succeeded and that the SDK/platform-tools folder is empty.

This should completely remove adb from your SDK.

  1. Now re-select the Android SDK Platform-Tools item
  2. Hit apply
  3. Check the on screen logs that installation was successful.

I suspect in my case an update of the platform tools had failed perhaps because it failed to kill a running adb.exe and only a partial update was applied resulting in an unstable adb installation.

查看更多
男人必须洒脱
6楼-- · 2019-02-12 05:28

In my case, the culprit is Visual Studio 2017. I found out this with the help of Vinayak's answer. I just closed Visual Studio 2017, then ADB started working.

查看更多
登录 后发表回答