@@ -267,14 +267,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
267
267
268
268
// Of the properties below only `buildForDevice` and `release` are currently used.
269
269
// Leaving the others with placeholder values so that they may not be forgotten in future implementations.
270
- const buildConfig : IBuildConfig = {
271
- buildForDevice : ! settings . isEmulator ,
272
- release : false ,
273
- device : settings . deviceIdentifier ,
274
- provision : null ,
275
- teamId : null ,
276
- projectDir : settings . projectDir
277
- } ;
270
+ const buildConfig = this . getInstallApplicationBuildConfig ( settings . deviceIdentifier , settings . projectDir , { isEmulator : settings . isEmulator } ) ;
278
271
debugData . pathToAppPackage = this . $platformService . lastOutputPath ( settings . platform , buildConfig , projectData , settings . outputPath ) ;
279
272
const debugInfo = await this . $debugService . debug ( debugData , settings . debugOptions ) ;
280
273
const result = this . printDebugInformation ( debugInfo , settings . debugOptions . forceDebuggerAttachedEvent ) ;
@@ -489,7 +482,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
489
482
await this . $platformService . validateInstall ( options . device , options . projectData , options , options . deviceBuildInfoDescriptor . outputPath ) ;
490
483
const shouldInstall = await this . $platformService . shouldInstall ( options . device , options . projectData , options , options . deviceBuildInfoDescriptor . outputPath ) ;
491
484
if ( shouldInstall ) {
492
- await this . $platformService . installApplication ( options . device , { release : false } , options . projectData , pathToBuildItem , options . deviceBuildInfoDescriptor . outputPath ) ;
485
+ const buildConfig = this . getInstallApplicationBuildConfig ( options . device . deviceInfo . identifier , options . projectData . projectDir , { isEmulator : options . device . isEmulator } ) ;
486
+ await this . $platformService . installApplication ( options . device , buildConfig , options . projectData , pathToBuildItem , options . deviceBuildInfoDescriptor . outputPath ) ;
493
487
appInstalledOnDeviceResult . appInstalled = true ;
494
488
}
495
489
@@ -502,7 +496,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
502
496
if ( rebuildInfo ) {
503
497
// Case where we have three devices attached, a change that requires build is found,
504
498
// we'll rebuild the app only for the first device, but we should install new package on all three devices.
505
- await this . $platformService . installApplication ( options . device , { release : false } , options . projectData , rebuildInfo . pathToBuildItem , options . deviceBuildInfoDescriptor . outputPath ) ;
499
+ const buildConfig = this . getInstallApplicationBuildConfig ( options . device . deviceInfo . identifier , options . projectData . projectDir , { isEmulator : options . device . isEmulator } ) ;
500
+ await this . $platformService . installApplication ( options . device , buildConfig , options . projectData , rebuildInfo . pathToBuildItem , options . deviceBuildInfoDescriptor . outputPath ) ;
506
501
return rebuildInfo . pathToBuildItem ;
507
502
}
508
503
@@ -875,6 +870,19 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
875
870
}
876
871
}
877
872
873
+ private getInstallApplicationBuildConfig ( deviceIdentifier : string , projectDir : string , opts : { isEmulator : boolean } ) : IBuildConfig {
874
+ const buildConfig : IBuildConfig = {
875
+ buildForDevice : ! opts . isEmulator ,
876
+ release : false ,
877
+ device : deviceIdentifier ,
878
+ provision : null ,
879
+ teamId : null ,
880
+ projectDir
881
+ } ;
882
+
883
+ return buildConfig ;
884
+ }
885
+
878
886
public emitLivesyncEvent ( event : string , livesyncData : ILiveSyncEventData ) : boolean {
879
887
this . $logger . trace ( `Will emit event ${ event } with data` , livesyncData ) ;
880
888
return this . emit ( event , livesyncData ) ;
0 commit comments