Testing iOS multiple device - Java client

Good morning.
I’m trying to use appium, with java client.
I had a few problems to start server from java code, but this is not important, and I can use the driver to manage my app.
Now, I would use two drivers on two different devices simultaneously.
Is there a way to do this, using a single Mac?

I saw that there was a restriction in Automator to use 1 device for Mac… Is there always this problem, in 2016?

Thanks!

Hi Griffith,
You can run multiple iOS devices from single mac machine.
to do so, you need to launch appium server instance with two tmp directory locations.
appium -tmp -p 6001
appium -tmp -p 6002

Thanks,
Priyank Shah

Thank you…
I tried to do this, but i saw that, when i create another driver, this driver kills the other instance of Instrument…
I used this code:
appium -p 4723 --tmp /tmp/tmp4723 -bp 5723 --session-override --> First instance
appium -p 4724 --tmp /tmp/tmp4724 -bp 5724 --session-override --> Second instance

basically, you need to instantiate two desired capabilities (with device UDID), which binds with each server instance.

I also did it…
I used this code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, APPIUM_NEW_COMMAND_TIMEOUT);
capabilities.setCapability(MobileCapabilityType.TAKES_SCREENSHOT, true);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.APP, appPath);
capabilities.setCapability(MobileCapabilityType.UDID, udid);
driver = new IOSDriver<>(new URL(“http://127.0.0.1:”+portNumber+"/wd/hub"), capabilities);

DesiredCapabilities capabilities1 = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, APPIUM_NEW_COMMAND_TIMEOUT);
capabilities.setCapability(MobileCapabilityType.TAKES_SCREENSHOT, true);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.APP, appPath);
capabilities.setCapability(MobileCapabilityType.UDID, udid1);
driver1 = new IOSDriver<>(new URL("http://127.0.0.1:"+portNumber1+"/wd/hub"), capabilities1);

DesiredCapabilities capabilities2 = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, APPIUM_NEW_COMMAND_TIMEOUT);
capabilities.setCapability(MobileCapabilityType.TAKES_SCREENSHOT, true);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.APP, appPath);
capabilities.setCapability(MobileCapabilityType.UDID, udid2);
driver2 = new IOSDriver<>(new URL("http://127.0.0.1:"+portNumber2+"/wd/hub"), capabilities2);