Appium Server Hangs when restarted after a failed test

Appium just stopes, and I’m not getting any type of error message.

The 1st test fails on an unexpected dialog box. The code then stops the appium server, and is suppose to restarts appium server again. This didn’t occur, the automation just froze.

I figured out it froze because i didn’t have an driver.quit() after the error. Once I added that, the test executed as expected.

I’m trying to figure out why stopping the appium server without doing a driver.quit() wouldn’t allow me to start the server again. I’m guessing there is a process that needs to be killed.

Anyone run into this or have any ideas?



@dduphorn mine way to start appium server

  1. kill everything on port i am going to use with appium server
  2. add “–session-override” flag also in case (this should resolve your case)


I have this for killing my ports.

String[] command1 = {“sh”, “-c”, “lsof -P | grep ':”+strAppiumPort+"’ | awk ‘{print $2}’ | xargs kill -9"};
try {Runtime.getRuntime().exec(command1);

And it looks like i had --session-overide commented out. I’ll uncomment and try again.



I uncommented the code and it still failed.

If I don’t start and stop the server between test case I get the following error. An unknown server-side error occurred while processing the command. Original error: Error occured while starting App.

I’ll keep trying to narrow it down.