77 IBuildConfig ,
88 IiOSBuildConfig ,
99} from "../../definitions/project" ;
10+ import { IXcconfigService } from "../../declarations" ;
1011import { IPlatformData } from "../../definitions/platform" ;
1112import { IFileSystem } from "../../common/declarations" ;
1213import { injector } from "../../common/yok" ;
@@ -21,7 +22,8 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
2122 private $devicesService : Mobile . IDevicesService ,
2223 private $fs : IFileSystem ,
2324 private $iOSWatchAppService : IIOSWatchAppService ,
24- private $logger : ILogger
25+ private $logger : ILogger ,
26+ private $xcconfigService : IXcconfigService
2527 ) { }
2628
2729 public async getBuildForSimulatorArgs (
@@ -131,10 +133,19 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
131133 platformData . normalizedPlatformName ,
132134 constants . BUILD_XCCONFIG_FILE_NAME
133135 ) ;
134-
135- if ( this . $fs . exists ( BUILD_SETTINGS_FILE_PATH ) ) {
136- extraArgs . push ( "-xcconfig" ) ;
137- extraArgs . push ( BUILD_SETTINGS_FILE_PATH ) ;
136+ // Only include explit deploy target if one is defined
137+ // Note: we could include entire file via -xcconfig flag
138+ // however doing so introduces unwanted side effects
139+ // like cocoapods issues related to ASSETCATALOG_COMPILER_APPICON_NAME
140+ // references: https://medium.com/@iostechset /why-cocoapods-eats-app-icons-79fe729808d4
141+ // https://github.com/CocoaPods/CocoaPods/issues/7003
142+ const deployTargetProperty = "IPHONEOS_DEPLOYMENT_TARGET" ;
143+ const deployTargetVersion = this . $xcconfigService . readPropertyValue (
144+ BUILD_SETTINGS_FILE_PATH ,
145+ deployTargetProperty
146+ ) ;
147+ if ( deployTargetVersion ) {
148+ extraArgs . push ( `${ deployTargetProperty } =${ deployTargetVersion } ` ) ;
138149 }
139150
140151 if ( this . $fs . exists ( xcworkspacePath ) ) {
0 commit comments