Skip to content

Commit 84b1c3a

Browse files
committed
add wdaPort for simulators
1 parent ea3f897 commit 84b1c3a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plugin.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ export default class DevicePlugin extends BasePlugin {
3131
await this.commandsQueueGuard.acquire('DeviceManager', async function () {
3232
await fetchDevices();
3333
freeDevice = devices.getFreeDevice(caps.firstMatch[0]['platformName']);
34-
if (freeDevice) {
34+
if (freeDevice && caps.firstMatch[0]['platformName'] === 'android') {
3535
caps.firstMatch[0]['appium:udid'] = freeDevice.udid;
3636
caps.firstMatch[0]['appium:deviceName'] = freeDevice.udid;
3737
caps.firstMatch[0]['appium:systemPort'] = await getPort();
3838
devices.blockDevice(freeDevice);
3939
log.info(`Device UDID ${freeDevice.udid} is blocked for execution.`);
40+
} else if (freeDevice && caps.firstMatch[0]['platformName'] === 'iOS') {
41+
caps.firstMatch[0]['appium:udid'] = freeDevice.udid;
42+
caps.firstMatch[0]['appium:deviceName'] = freeDevice.udid;
43+
caps.firstMatch[0]['appium:wdaLocalPort'] = await getPort();
44+
devices.blockDevice(freeDevice);
45+
log.info(`Device UDID ${freeDevice.udid} is blocked for execution.`);
4046
} else {
4147
throw new Error('No free device is available to create session');
4248
}

0 commit comments

Comments
 (0)