@@ -141,7 +141,7 @@ function getAllFileNames(folder) {
141
141
// return files;
142
142
// }
143
143
144
- export function shutdown ( processToKill : childProcess . ChildProcess , verbose ) {
144
+ export function shutdown ( processToKill : any , verbose ) {
145
145
try {
146
146
if ( processToKill && processToKill !== null ) {
147
147
if ( isWin ( ) ) {
@@ -307,22 +307,39 @@ export function getAppPath(caps: INsCapabilities) {
307
307
}
308
308
} else {
309
309
const iosPlatformsPath = 'platforms/ios/build' ;
310
- const appType = caps . runType || caps . device . type === DeviceType . SIMULATOR ? "sim" : "device" ;
311
- basePath = appType . includes ( "device" ) ? `${ iosPlatformsPath } /device/**/*.ipa` : `${ iosPlatformsPath } /emulator/**/*.app` ;
310
+ // possible paths
311
+ // "Release-iphoneos"
312
+ // "Release-iphonesimulator"
313
+ // "Debug-iphoneos"
314
+ // "Debug-iphonesimulator"
315
+ // "device"
316
+ // "emulator"
317
+ if ( caps . device && caps . device . type ) {
318
+ basePath = caps . device . type === DeviceType . DEVICE ? `${ iosPlatformsPath } /**/*.ipa` : `${ iosPlatformsPath } /**/*.app` ;
319
+ } else if ( caps . runType . startsWith ( "dev" ) ) {
320
+ basePath = `${ iosPlatformsPath } /**/*.ipa` ;
321
+ } else {
322
+ basePath = `${ iosPlatformsPath } /**/*.app` ;
323
+ }
312
324
}
313
325
}
314
326
315
327
let apps = glob . sync ( basePath ) ;
316
-
317
328
if ( ! apps || apps . length === 0 ) {
318
- apps = glob . sync ( `${ caps . projectDir } ` )
319
- . filter ( function ( file ) {
320
- return file . endsWith ( ".ipa" ) || file . endsWith ( ".app" ) || file . endsWith ( ".apk" )
321
- } ) ;
329
+ if ( caps . isAndroid ) {
330
+ apps = glob . sync ( `${ caps . projectDir } /**/*.apk` ) ;
331
+ }
332
+ if ( caps . isIOS ) {
333
+ if ( caps . runType . startsWith ( "dev" ) ) {
334
+ apps = glob . sync ( `${ caps . projectDir } /**/*.app` ) ;
335
+ } else {
336
+ apps = glob . sync ( `${ caps . projectDir } /**/*.ipa` ) ;
337
+ }
338
+ }
322
339
}
323
340
324
341
if ( ! apps || apps . length === 0 ) {
325
- logError ( `No 'app' capability provided or the convension for 'runType'${ caps . runType } is not as excpeced !
342
+ logError ( `No 'app' capability provided or the convention for 'runType'${ caps . runType } is not as expected !
326
343
In order to automatically search and locate app package please use 'device' in your 'runType' name. E.g --runType device.iPhone7.iOS110, --runType sim.iPhone7.iOS110 or
327
344
specify correct app path` ) ;
328
345
}
@@ -582,7 +599,7 @@ const convertObjToString = obj => {
582
599
return "" ;
583
600
}
584
601
585
- export const shouldUserMobileDevicesController = ( args : INsCapabilities ) => {
602
+ export const shouldUserMobileDevicesController = ( args : INsCapabilities ) => {
586
603
const useDsCS = process . env [ "USE_DEVICES_CONTROLLER_SERVER" ] || false ;
587
604
const useMDsCS = process . env [ "USE_MOBILE_DEVICES_CONTROLLER_SERVER" ] || false ;
588
605
0 commit comments