@@ -30,7 +30,8 @@ import {
30
30
encodeImageToBase64 ,
31
31
ensureReportsDirExists ,
32
32
checkImageLogType ,
33
- adbShellCommand
33
+ adbShellCommand ,
34
+ logWarn
34
35
} from "./utils" ;
35
36
36
37
import { INsCapabilities } from "./interfaces/ns-capabilities" ;
@@ -280,6 +281,8 @@ export class AppiumDriver {
280
281
}
281
282
} catch ( error ) {
282
283
args . verbose = true ;
284
+ console . log ( "===============================" ) ;
285
+ console . log ( "" , error )
283
286
if ( ! args . ignoreDeviceController && error && error . message && error . message . includes ( "Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]" ) ) {
284
287
await DeviceManager . kill ( args . device ) ;
285
288
await DeviceController . startDevice ( args . device ) ;
@@ -303,11 +306,11 @@ export class AppiumDriver {
303
306
console . log ( "Retry launching appium driver!" ) ;
304
307
hasStarted = false ;
305
308
306
- if ( error && error . message && error . message . includes ( "WebDriverAgent" ) ) {
307
- const freePort = await findFreePort ( 100 , args . wdaLocalPort ) ;
308
- console . log ( "args.appiumCaps['wdaLocalPort']" , freePort ) ;
309
- args . appiumCaps [ "wdaLocalPort" ] = freePort ;
310
- }
309
+ // if (error && error.message && error.message.includes("WebDriverAgent")) {
310
+ // const freePort = await findFreePort(100, args.wdaLocalPort);
311
+ // console.log("args.appiumCaps['wdaLocalPort']", freePort);
312
+ // args.appiumCaps["wdaLocalPort"] = freePort;
313
+ // }
311
314
}
312
315
313
316
if ( hasStarted ) {
@@ -883,7 +886,7 @@ export class AppiumDriver {
883
886
}
884
887
}
885
888
886
- private static async applyAdditionalSettings ( args ) {
889
+ private static async applyAdditionalSettings ( args : INsCapabilities ) {
887
890
if ( args . isSauceLab ) return ;
888
891
889
892
args . appiumCaps [ 'udid' ] = args . appiumCaps [ 'udid' ] || args . device . token ;
@@ -900,6 +903,11 @@ export class AppiumDriver {
900
903
args . appiumCaps [ "wdaStartupRetries" ] = 5 ;
901
904
args . appiumCaps [ "shouldUseSingletonTestManager" ] = args . appiumCaps . shouldUseSingletonTestManager ;
902
905
906
+ if ( args . derivedDataPath ) {
907
+ args . appiumCaps [ "derivedDataPath" ] = `${ args . derivedDataPath } /${ args . device . token } ` ;
908
+ logWarn ( 'Changed derivedDataPath to: ' , args . appiumCaps [ "derivedDataPath" ] ) ;
909
+ }
910
+
903
911
// It looks we need it for XCTest (iOS 10+ automation)
904
912
if ( args . appiumCaps . platformVersion >= 10 && args . wdaLocalPort ) {
905
913
console . log ( `args.appiumCaps['wdaLocalPort']: ${ args . wdaLocalPort } ` ) ;
0 commit comments