HI @sugatmankar,
I tried running from my end with appium server running programatically but it actually behaves unexpectedly as sometimes it opens the app on device and simulator but skips execution on either device. I used below code for running appium instances:
String device=REGIONAL.getProperty(object);
String[] deviceData =device.split(Constants.OBJECT_SPLIT);
AppiumDriverLocalService service;
Map env = new HashMap<>(System.getenv());
env.put("PATH", "/usr/local/bin:" + env.get("PATH"));
service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withEnvironment(env).withIPAddress("127.0.0.1").usingPort(port).usingDriverExecutable(new File("/usr/local/bin/node")).withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js")).withLogFile(new File("/Users/cex/Downloads/iOS/iOSAutomationHybridFramework/src/com/cexwebuy/logs/Application.log")));
if(device.trim().contains(deviceData[0])){//437593bb0b56b28071b0b8287b2c6844f680178c
capabilities.setCapability(CapabilityType.VERSION, CONFIG.getProperty("version"));
capabilities.setCapability(CapabilityType.PLATFORM, CONFIG.getProperty("platform"));
capabilities.setCapability("deviceName", CONFIG.getProperty("Device"));
capabilities.setCapability("udid", CONFIG.getProperty("UDID"));// 6 plus
capabilities.setCapability("bundleId", CONFIG.getProperty("bundleID"));//""com.cex.ecomiosapp""//com.cex.cexdevinternal//com.cex.ecomapp
//capabilities.setCapability("bundleId", "com.cex.ecomiosapp");
capabilities.setCapability("automationName", CONFIG.getProperty("automationName"));
capabilities.setCapability("ipa", CONFIG.getProperty("appName"));
capabilities.setCapability("NoReset", CONFIG.getProperty("noResetVal"));
capabilities.setCapability("realDeviceLogger",CONFIG.getProperty("deviceLog"));
capabilities.setCapability("session-override", CONFIG.getProperty("sessionOvrdVal"));
//capabilities.setCapability("useNewWDA", false);
capabilities.setCapability("wdaLocalPort", devicePort);
//capabilities.setCapability("startIWDP", true);
capabilities.setCapability("clearSystemFiles", true);
capabilities.setCapability("newCommandTimeout",CONFIG.getProperty("commandTimeOut"));
driver = new IOSDriver(service, capabilities);
}
//driver = new IOSDriver(service, capabilities);}
if(device.trim().contains(deviceData[1])){
capabilities.setCapability(CapabilityType.VERSION, CONFIG.getProperty("version1"));
capabilities.setCapability(CapabilityType.PLATFORM, CONFIG.getProperty("platform"));
capabilities.setCapability("deviceName", CONFIG.getProperty("Device1"));
capabilities.setCapability("udid", CONFIG.getProperty("UDID1"));// 6 plus
capabilities.setCapability("bundleId", CONFIG.getProperty("bundleID"));//""com.cex.ecomiosapp""//com.cex.cexdevinternal//com.cex.ecomapp
capabilities.setCapability("automationName", CONFIG.getProperty("automationName"));
capabilities.setCapability("ipa", CONFIG.getProperty("appName"));
capabilities.setCapability("NoReset", CONFIG.getProperty("noResetVal"));
//capabilities.setCapability("realDeviceLogger",CONFIG.getProperty("deviceLog"));
capabilities.setCapability("session-override", CONFIG.getProperty("sessionOvrdVal"));
capabilities.setCapability("wdaLocalPort", devicePort);
capabilities.setCapability("clearSystemFiles", true);
capabilities.setCapability("newCommandTimeout",CONFIG.getProperty("commandTimeOut"));
}//service.getUrl()u//new URL("http://127.0.0.1:4723/wd/hub")
APP_LOGS.debug("Launching and Opening iOS Application");
driver = new IOSDriver<MobileElement>(service, capabilities);
Passing two udid's through split function. Most of the times while running script on device throws "Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted} .
My other concern is how to run appium server instances without AppiumDriverLocalService API .I meant running manually appium instances and then start the execution. currently if i start appium servers on two terminals throws error even though i customised WDA and replace with appium-xcuitest-driver folder.
Please help !