File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,18 @@ export default class DevicePlugin extends BasePlugin {
31
31
await this . commandsQueueGuard . acquire ( 'DeviceManager' , async function ( ) {
32
32
await fetchDevices ( ) ;
33
33
freeDevice = devices . getFreeDevice ( caps . firstMatch [ 0 ] [ 'platformName' ] ) ;
34
- if ( freeDevice ) {
34
+ if ( freeDevice && caps . firstMatch [ 0 ] [ 'platformName' ] === 'android' ) {
35
35
caps . firstMatch [ 0 ] [ 'appium:udid' ] = freeDevice . udid ;
36
36
caps . firstMatch [ 0 ] [ 'appium:deviceName' ] = freeDevice . udid ;
37
37
caps . firstMatch [ 0 ] [ 'appium:systemPort' ] = await getPort ( ) ;
38
38
devices . blockDevice ( freeDevice ) ;
39
39
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.` ) ;
40
46
} else {
41
47
throw new Error ( 'No free device is available to create session' ) ;
42
48
}
You can’t perform that action at this time.
0 commit comments