I was having 2 version of Appium.
One was installed on Windows/Program Files and Other version was .zip extract.
I was not able to start the Appium server and got below error -
error: Couldn't start Appium REST http interface listener. Requested port is already in use. Please make sure there's no other instance of Appium running already.
Start the Windows Task Manager by pressing Ctrl+alt+Del.
Under Processes tab kill the 'node.exe
' process.
Try to start the Appium server again
In case you don't find the 'node.exe' in task manager (which happened with me), you can try the following:
Stop the 'Appium Server'
In the Appium Server, click on the 'Settings' gear icon and change the 'port' to something else, say 4725
In your code, where you have invoked the 'AndroidDriver', change the port to the value you have updated above:
(AndroidDriver driver=new AndroidDriver(new URL("http://127.0.0.1:4725/wd/hub"),cap );)
- Start the Appium Server again.
Stop the currently running appium server and start it again.
I tried killing the process as told above node.js
I didn't find the node.js running.
One solution I would like to share ,which worked for me is ....try setting different port numbers in appium setting ex:4725 is default there change it to 4726 ...It will run next time if you face the same issue change back to earlier 4725.
Start the Windows task manager by holding Ctrl+Alt+Del keys together. Kill the process adb.exe
. Close appium and reconnect your mobile device then start appium.
I was also facing this problem and I got it resolved through these steps.
Go to Appium(Android windows) setting change to any port number and start server again.
once server is started again change to original port.
appium -a 127.0.0.1 -p 4723
Here the port number is 4723. If the server is up in one port, you can try initializing the server in a different port.
Use the command
appium -a 127.0.0.1 -p (4724 or 4725 or any port number).
It will work