@@ -348,7 +348,8 @@ export class PlatformService implements IPlatformService {
348348 return ( ( ) => {
349349 let shouldBuild = this . preparePlatform ( platform , false ) . wait ( ) ;
350350 let platformData = this . $platformsData . getPlatformData ( platform ) ;
351- let buildInfoFile = path . join ( platformData . projectRoot , buildInfoFileName ) ;
351+ let buildInfoFilePath = this . getBuildOutputPath ( platform , platformData , buildConfig ) ;
352+ let buildInfoFile = path . join ( buildInfoFilePath , buildInfoFileName ) ;
352353 if ( ! shouldBuild ) {
353354 if ( this . $fs . exists ( buildInfoFile ) . wait ( ) ) {
354355 let buildInfoText = this . $fs . readText ( buildInfoFile ) . wait ( ) ;
@@ -364,6 +365,14 @@ export class PlatformService implements IPlatformService {
364365 } ) . future < void > ( ) ( ) ;
365366 }
366367
368+ private getBuildOutputPath ( platform : string , platformData : IPlatformData , buildConfig ?: IBuildConfig ) : string {
369+ let buildForDevice = buildConfig ? buildConfig . buildForDevice : false ;
370+ if ( platform === this . $devicePlatformsConstants . iOS . toLowerCase ( ) ) {
371+ return buildForDevice ? platformData . deviceBuildOutputPath : platformData . emulatorBuildOutputPath ;
372+ }
373+ return platformData . deviceBuildOutputPath ;
374+ }
375+
367376 public buildForDeploy ( platform : string , buildConfig ?: IBuildConfig ) : IFuture < void > {
368377 return ( ( ) => {
369378 platform = platform . toLowerCase ( ) ;
@@ -467,7 +476,7 @@ export class PlatformService implements IPlatformService {
467476 } else {
468477 let deviceBuildConfig = buildConfig || { } ;
469478 deviceBuildConfig . buildForDevice = true ;
470- this . prepareAndBuild ( platform , buildConfig ) . wait ( ) ;
479+ this . prepareAndBuild ( platform , deviceBuildConfig ) . wait ( ) ;
471480 packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
472481 }
473482 }
0 commit comments