阿皮姆问题.如果“listen eaddrinuse: address already in use",如何阻止?为什么它没有停止? [英] Appium Question. If "listen eaddrinuse: address already in use", how to stop it? why it didn't stop?
问题描述
我已经使用默认的 0.0.0.0:4723 地址和端口启动 Appium,但随后出现此错误:
I had been started Appium using default 0.0.0.0:4723 address and port, but then I got this error:
C:Userme>appium
[Appium] Welcome to Appium v1.17.0
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.
Fatal Error: listen EADDRINUSE: address already in use 0.0.0.0:4723
at Server.setupListenHandle [as _listen2] (net.js:1309:16)
at listenInCluster (net.js:1357:12)
at doListen (net.js:1496:7)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
我发现我可以使用以下方法更改端口:appium -p 4724
I found that I can change the port using:
appium -p 4724
我还发现我可以关闭与 0.0.0.0:4723 的连接(如果有),无论是在 Appium 桌面应用程序还是第二个 CMD 上.我关闭了 Appium 桌面应用程序,我停止并关闭了任何其他 CMD,但我仍然遇到相同的致命错误:听 EADDRINUSE:地址已经在使用 0.0.0.0:4723
I also found that I can close connection to 0.0.0.0:4723, if any, whether on the Appium desktop app or a second CMD. I closed Appium desktop app, I stopped and closed any other CMD, but I still got the same Fatal Error: listen EADDRINUSE: address already in use 0.0.0.0:4723
那么我的问题:如何停止这个已经使用的地址?而且,为什么它没有停止?
Then my questions: How to stop this already used address? and, Why it didn't stop?
我可以使用另一个端口来启动我的服务器,但我不应该能够简单地停止与 4723 端口的连接并再次使用它吗?
I am ok with using another port to start my server, but shouldn't I be able to simply stop the connection to 4723 port and using it again?
推荐答案
通过导航到开始 > 运行 > 键入 cmd > 右键单击命令提示符,然后选择以管理员身份运行,以管理员模式打开 CMD 窗口.
Open a CMD window in Administrator mode by navigating to Start > Run > type cmd > right-click Command Prompt, then select Run as administrator.
C:Usersadmin>netstat -ano|findstr "PID :4723"
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:4723 0.0.0.0:0 LISTENING 6134
要杀死进程,请输入要杀死的端口的 PID(将显示在 CMD 屏幕上)[/f 是力]
To kill the process type the PID of the port you want to kill (which will be displayed on the CMD screen) [/f is force]
taskkill /pid 6134 /f
这篇关于阿皮姆问题.如果“listen eaddrinuse: address already in use",如何阻止?为什么它没有停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!