Hi Priyank_Shah
I was using this to Start/Stop my Appium Server. It has been working for the past 3 months. But now i upgrade to Appium 1.4.16.1 and this doesn't start the Appium Server and doesn't throws any error. Please let me know if I am doing anything wrong.
public class SampleJavaTest {
private static Process process;
public static String APPIUM_NODE_FILEPATH = "C:/Program Files (x86)/Appium/node.exe";
public static String APPIUM_SERVERSCRIPT_FILEPATH = "C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js";
public static String APPIUMSERVERSTART = "\"" + APPIUM_NODE_FILEPATH + "\" \"" + APPIUM_SERVERSCRIPT_FILEPATH + "\" ";
public void startServer() throws IOException, InterruptedException
{
Runtime runtime = Runtime.getRuntime();
process = runtime.exec(APPIUMSERVERSTART);
Thread.sleep(5000);
if (process != null)
{
System.out.println("Appium server started");
}
}
/**
* DOCUMENT ME!
*/
public void stopServer()
{
if (process != null)
{
process.destroy();
}
System.out.println("Appium server stop");
}
public static void main(String args[]) throws IOException, InterruptedException {
startAppiumServer();
stopAppiumServer();
}