@@ -267,14 +267,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
267267
268268 // Of the properties below only `buildForDevice` and `release` are currently used.
269269 // 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 } ) ;
278271 debugData . pathToAppPackage = this . $platformService . lastOutputPath ( settings . platform , buildConfig , projectData , settings . outputPath ) ;
279272 const debugInfo = await this . $debugService . debug ( debugData , settings . debugOptions ) ;
280273 const result = this . printDebugInformation ( debugInfo , settings . debugOptions . forceDebuggerAttachedEvent ) ;
@@ -489,7 +482,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
489482 await this . $platformService . validateInstall ( options . device , options . projectData , options , options . deviceBuildInfoDescriptor . outputPath ) ;
490483 const shouldInstall = await this . $platformService . shouldInstall ( options . device , options . projectData , options , options . deviceBuildInfoDescriptor . outputPath ) ;
491484 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 ) ;
493487 appInstalledOnDeviceResult . appInstalled = true ;
494488 }
495489
@@ -502,7 +496,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
502496 if ( rebuildInfo ) {
503497 // Case where we have three devices attached, a change that requires build is found,
504498 // 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 ) ;
506501 return rebuildInfo . pathToBuildItem ;
507502 }
508503
@@ -875,6 +870,19 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
875870 }
876871 }
877872
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+
878886 public emitLivesyncEvent ( event : string , livesyncData : ILiveSyncEventData ) : boolean {
879887 this . $logger . trace ( `Will emit event ${ event } with data` , livesyncData ) ;
880888 return this . emit ( event , livesyncData ) ;
0 commit comments