Starting / stopping appium server on remote machine

I have a test script which performs this flow:

  1. Start appium server from code (script)
  2. Create android driver
  3. Perform test
  4. Stop appium server from code

When I run it locally on 127.0.01 it works fine,
The problem is when I am trying to run the test on another machine.

I have two issues:

  1. When I am trying to start server on remote machine (see log)

Going to execute start appium server: cmd /c C://appium//Appium//node.exe C://appium//Appium//node_modules\appium\bin\appium.js --address --port 4723
e[33mwarne[39m: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
e[31merrore[39m: Couldn’t start Appium REST http interface listener. Requested address is not available.
2015-11-23 16:36:34,428 INFO [main] ( - Trying to set ANDROID driver
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 209 milliseconds
Build info: version: ‘2.42.2’, revision: ‘6a6995d31c7c56c340d6f45a76976d43506cd6cc’, time: ‘2014-06-03 10:52:47’
System info: host: ‘QTVR-AII015’, ip: ‘’, ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.7.0_79’
Driver info:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

  1. In the stopping script there is no possibility to stop remotely (no ip / port in script)

cmd /c taskkill /F /IM node.exe

Thanks for the help

Is there another Appium process running? Take a look in the Task Manager & see. Maybe something is not getting stopped properly?

No, there is no appium or java process open…
Is starting the server from code on remote machine supported?
And if yes, how to close from code the server on a remote machine as well? (there is no ip / port )

Ah, now I understand. AFAIK there is no way to start the remote server from Appium. If I were you I would code up a start/stop method (using SSH) and run it that way.

Do you have some links / examples that will help?
I would appreciate it :smile:

One more thing, I am working on Android / Windows, does SSH gives a solution?

I have no idea what programming language you are using.

Programming language : Java
OS ob remote server and running server: Windows
Platform : Android

Ok, my knowledge of Windows is fairly limited. Does it have a native SSH server or will you need to install something like Cygwin? Regardless, your first move is to get a working SSH server on the remote machine.

Once that’s done, you need to figure out which of the many SSH libraries in Java you’d like to use. There is a good discussion with some coding examples here:

You need to add methods to your code that use these libraries, connect to the remote machine, issue commands, etc.