Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 阿皮姆问题。如果;倾听eaddrinuse:地址已在使用中“;,如何阻止它?为什么没有';停不下来?_Java_Appium_Appium Android - Fatal编程技术网

Java 阿皮姆问题。如果;倾听eaddrinuse:地址已在使用中“;,如何阻止它?为什么没有';停不下来?

Java 阿皮姆问题。如果;倾听eaddrinuse:地址已在使用中“;,如何阻止它?为什么没有';停不下来?,java,appium,appium-android,Java,Appium,Appium Android,我是使用默认的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 s

我是使用默认的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

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

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


我可以使用另一个端口启动服务器,但我是否可以简单地停止与4723端口的连接并再次使用它?

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

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

然后使用以下命令终止该进程

kill -9 PID
窗口的备用进程:

netstat -ano | findstr :4723
tskill typeyourPIDhere 

通过导航到开始>运行>键入CMD>右键单击命令提示符,在管理员模式下打开CMD窗口,然后选择以管理员身份运行

C:\Users\admin>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是力]

taskkill /pid 6134 /f
只需在命令行中执行上面的命令,即可结束Appium服务,而无需记住并了解进程id

taskkill /pid 6134 /f
taskkill /F /IM node.exe