Hi @suresh_p,
I do same actions too.
The idea is to launch 2 local server:
AppiumServiceBuilder serviceBuilder =
new AppiumServiceBuilder().withAppiumJS(new File(APPIUM_PATH)).usingAnyFreePort().withLogFile(
new File("/tmp/appium_" + System.currentTimeMillis() + "_" + appiumServer.getPort() + ".log")).withArgument(
GeneralServerFlag.LOG_LEVEL, "error:debug").withArgument(GeneralServerFlag.LOG_TIMESTAMP).withArgument(
GeneralServerFlag.LOCAL_TIMEZONE).withArgument(
GeneralServerFlag.TEMP_DIRECTORY, "/tmp/" + appiumServer.getPort()).usingPort(Integer.parseInt(appiumServer.getPort()));
serviceBuilder.build().start()
Then you can manage your devices in some collection and switch between them.
Hope i got you right,
Eitan.