Android - could not install *smartsocket* listener
当我尝试运行我的Android应用程序时,出现以下异常:
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
因此,我尝试使用以下命令手动进行操作:
adb kill-server
- 响应:*服务器未运行*
adb start-server
- 响应是下一个例外:
*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
我在任务管理器中寻找adb进程,但未运行。 有任何想法吗? 谢谢。
打开命令提示符并输入以下命令
netstat -ano |搜寻:5037
这将显示进程ID
TCP 127.0.0.1:5037 0.0.0.0:0听832
832是进程ID
现在运行命令
任务清单| findstr processID(例如任务列表| findstr 832)
它将显示进程名称,如bash.exe
只需转到任务管理器并结束任务bash.exe
并使用以下命令启动adb
亚行启动服务器
voillllaaaaaaa ........
如果您遇到这种情况不断发生,而杀死和重新启动仍然不起作用,则可能是adb安装出现问题。我必须重新安装adb才能解决此问题:
这应该从您的SDK中完全删除adb。
我怀疑在我的情况下,平台工具的更新失败了,也许是因为它未能杀死正在运行的adb.exe,并且仅应用了部分更新,导致adb安装不稳定。
我靠关闭自己一直在运行adb命令的shell并启动了一个新命令(由Vinayak Mestri的答案启发)来为自己解决了这一问题。
谢谢梅斯特里
使用5037端口列出进程ID
netstat -ano | findstr :5037
TCP 127.0.0.1:39187 127.0.0.1:5037成立5400
TCP 127.0.0.1:39188 127.0.0.1:5037成立5400
TCP 127.0.0.1:39798 127.0.0.1:5037成立5400
TCP 127.0.0.1:39902 127.0.0.1:5037成立7296
TCP 127.0.0.1:40148 127.0.0.1:5037成立5400
5400,7296是pid编号
taskkill /pid pidnumber
然后\ n
adb connect localhost:62001
adb服务器版本(41)与该客户端(36)不匹配;杀死...
*守护程序成功启动*
连接到本地主机:62001
您只需让"命令提示符"以管理员身份运行。
因此,您可以运行命令" nox_adb.exe connect 127.0.0.1:62001"
图片如下:
https://i.stack.imgur.com/fAmXz.png
重新启动adb服务器的外部终端(CMD)为我完成了这项工作:
1 2 | Android-SDK/platform-tools/adb.exe kill-server Android-SDK/platform-tools/adb.exe start-server |
就我而言,罪魁祸首是Visual Studio2017。我在Vinayak的答案的帮助下发现了这一点。我刚刚关闭Visual Studio 2017,然后亚行开始工作。