@@ -436,31 +436,44 @@ export class PlatformService implements IPlatformService {
436
436
let platformData = this . $platformsData . getPlatformData ( platform ) ;
437
437
438
438
this . $devicesService . initialize ( { platform : platform , deviceId : this . $options . device } ) . wait ( ) ;
439
- let packageFile : string = null ;
439
+ let packageFileDict : IStringDictionary = { } ;
440
440
441
441
let action = ( device : Mobile . IDevice ) : IFuture < void > => {
442
442
return ( ( ) => {
443
+
444
+ let packageFileKey = this . getPackageFileKey ( device ) ;
445
+ let packageFile = packageFileDict [ packageFileKey ] ;
443
446
if ( ! packageFile ) {
444
447
if ( this . $devicesService . isiOSSimulator ( device ) ) {
445
448
this . prepareAndExecute ( platform , ( ) => this . buildForDeploy ( platform , buildConfig ) ) . wait ( ) ;
446
449
packageFile = this . getLatestApplicationPackageForEmulator ( platformData ) . wait ( ) . packageName ;
447
450
} else {
448
- buildConfig = buildConfig || { } ;
449
- buildConfig . buildForDevice = true ;
450
- this . prepareAndExecute ( platform , ( ) => this . buildForDeploy ( platform , buildConfig ) ) . wait ( ) ;
451
+ let deviceBuildConfig = buildConfig || { } ;
452
+ deviceBuildConfig . buildForDevice = true ;
453
+ this . prepareAndExecute ( platform , ( ) => this . buildForDeploy ( platform , deviceBuildConfig ) ) . wait ( ) ;
451
454
packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
452
455
}
453
456
}
454
457
455
458
platformData . platformProjectService . deploy ( device . deviceInfo . identifier ) . wait ( ) ;
456
459
device . applicationManager . reinstallApplication ( this . $projectData . projectId , packageFile ) . wait ( ) ;
457
460
this . $logger . info ( `Successfully deployed on device with identifier '${ device . deviceInfo . identifier } '.` ) ;
461
+
462
+ packageFileDict [ packageFileKey ] = packageFile ;
463
+
458
464
} ) . future < void > ( ) ( ) ;
459
465
} ;
460
466
this . $devicesService . execute ( action , this . getCanExecuteAction ( platform ) ) . wait ( ) ;
461
467
} ) . future < void > ( ) ( ) ;
462
468
}
463
469
470
+ private getPackageFileKey ( device : Mobile . IDevice ) : string {
471
+ if ( this . $mobileHelper . isAndroidPlatform ( device . deviceInfo . platform ) ) {
472
+ return device . deviceInfo . platform . toLowerCase ( ) ;
473
+ }
474
+ return device . deviceInfo . platform . toLowerCase ( ) + device . deviceInfo . type ;
475
+ }
476
+
464
477
public deployOnDevice ( platform : string , buildConfig ?: IBuildConfig ) : IFuture < void > {
465
478
return ( ( ) => {
466
479
this . installOnDevice ( platform , buildConfig ) . wait ( ) ;
0 commit comments