@Venkatesh mine code is old style. i am starting appium server mysef:
// server 1
List list = new ArrayList<String>();
list.add("appium");
list.add("--log-level");
list.add("error");
list.add("--port");
list.add(appiumServer1_PortPublic);
list.add("--bootstrap-port");
list.add(String.valueOf(Integer.parseInt(appiumServer1_PortPublic)+1000));
list.add("--command-timeout");
list.add("180");
list.add("--session-override");
list.add("--log-timestamp");
// create the process builder
try {
ProcessBuilder pb1 = new ProcessBuilder(list);
//print inputStream to console
pb1.redirectErrorStream(true);
pb1.redirectOutput(ProcessBuilder.Redirect.INHERIT);
appium_Process = pb1.start();
} catch (Exception e) {
e.printStackTrace();
}
and after this opening driver later against ‘appiumServer1_PortPublic’ port. Server2 and driver2 is similar.