Appium问题。如果“监听eaddrinuse:地址已在使用中”,该如何停止呢?为什么它没有停止?

问题描述 投票:1回答:1

我已经使用默认的0.0.0.0:4723地址和端口启动了Appium,但随后出现此错误:

C:\User\me>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

我还发现,无论在Appium桌面应用程序还是第二个CMD上,我都可以关闭与0.0.0.0:4723的连接。我关闭了Appium桌面应用程序,我停止并关闭了所有其他CMD,但是仍然得到相同的致命错误:听EADDRINUSE:地址已在使用0.0.0.0:4723

然后我的问题:如何停止这个已经使用的地址?而且,为什么它没有停止?

我可以使用其他端口启动服务器,但是我不能简单地停止与4723端口的连接并再次使用它吗?

java appium appium-android
1个回答
0
投票

这表示该端口已在使用中。您必须终止在该端口中运行的进程。

在命令提示符/终端中键入以下内容以获取进程ID(PID)。

ps aux | grep appium

然后使用以下命令杀死该进程

kill -9 PID

窗口的替代处理:

netstat -ano | findstr :4723
tskill typeyourPIDhere 
© www.soinside.com 2019 - 2024. All rights reserved.