Hi,
Even I am following the same approach but I am unable to launch the appium programmatically. On windows same happen without any issue but on MAC OS its not launching appium.
I was trying this code on MAC:
CommandLine command = new CommandLine("/Applications/Appium.app/Contents/Resources/node/bin/node");
command.addArgument("/Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/appium.js", false);
command.addArgument("--address", false);
command.addArgument("0.0.0.0");
command.addArgument("--port", false);
command.addArgument("4723");
command.addArgument("--no-reset", false);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
executor.execute(command, resultHandler);
Even I tried with ProcessBuilder class. But no success