Starting Appium server on mac using java client 3.2.0


#1

Hi All,
Has somebody tried starting Appium server on mac using java client 3.2.0, if yes please share code.

Regards,
Venkatesh


Start and Stop Appium from mac using Java
#2

Did you search there is already a thread for this.


#3

yes I did, I was interested in doing that using java client 3.2.0.


#5

Hy, try use shell comand for do that.

CommandLine command = new CommandLine(
        "/Applications/Appium.app/Contents/Resources/node/bin/node");
command.addArgument(
        "/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js",
        false);
command.addArgument("--address", false);
command.addArgument("127.0.0.1");
command.addArgument("--port", false);
command.addArgument("4723");
command.addArgument("--full-reset", false);
//command.addArgument("--session-override", true);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
try {
    executor.execute(command, resultHandler);
    Thread.sleep(5000);
    System.out.println("Appium server started.");
} catch (IOException e) {
    e.printStackTrace();

#6

the code you mentioned will work and i have used it earlier, but that is not using API provided by java client 3.2.0 AppiumServiceBuilder Class.

http://appium.github.io/java-client/


#7

Hi @pcuco. You saved my day. This works perfectly fine for me.

How to stop the server started.