7
7
IBuildConfig ,
8
8
IiOSBuildConfig ,
9
9
} from "../../definitions/project" ;
10
+ import { IXcconfigService } from "../../declarations" ;
10
11
import { IPlatformData } from "../../definitions/platform" ;
11
12
import { IFileSystem } from "../../common/declarations" ;
12
13
import { injector } from "../../common/yok" ;
@@ -21,7 +22,8 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
21
22
private $devicesService : Mobile . IDevicesService ,
22
23
private $fs : IFileSystem ,
23
24
private $iOSWatchAppService : IIOSWatchAppService ,
24
- private $logger : ILogger
25
+ private $logger : ILogger ,
26
+ private $xcconfigService : IXcconfigService
25
27
) { }
26
28
27
29
public async getBuildForSimulatorArgs (
@@ -131,10 +133,19 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
131
133
platformData . normalizedPlatformName ,
132
134
constants . BUILD_XCCONFIG_FILE_NAME
133
135
) ;
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 } ` ) ;
138
149
}
139
150
140
151
if ( this . $fs . exists ( xcworkspacePath ) ) {
0 commit comments