@@ -251,6 +251,22 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
251
251
let projectRoot = platformData . projectRoot ;
252
252
let archivePath = options . archivePath ;
253
253
let buildOutputPath = path . join ( projectRoot , "build" , "device" ) ;
254
+ let exportOptionsMethod = await this . getExportOptionsMethod ( projectData ) ;
255
+ let plistTemplate = `<?xml version="1.0" encoding="UTF-8"?>
256
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
257
+ <plist version="1.0">
258
+ <dict>
259
+ <key>method</key>
260
+ <string>${ exportOptionsMethod } </string>
261
+ <key>uploadBitcode</key>
262
+ <false/>
263
+ </dict>
264
+ </plist>` ;
265
+
266
+ // Save the options...
267
+ temp . track ( ) ;
268
+ let exportOptionsPlist = temp . path ( { prefix : "export-" , suffix : ".plist" } ) ;
269
+ this . $fs . writeFile ( exportOptionsPlist , plistTemplate ) ;
254
270
255
271
// The xcodebuild exportPath expects directory and writes the <project-name>.ipa at that directory.
256
272
let exportPath = path . resolve ( options . exportDir || buildOutputPath ) ;
@@ -259,7 +275,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
259
275
let args = [ "-exportArchive" ,
260
276
"-archivePath" , archivePath ,
261
277
"-exportPath" , exportPath ,
262
- "-exportOptionsPlist" , platformData . configurationFilePath
278
+ "-exportOptionsPlist" , exportOptionsPlist
263
279
] ;
264
280
await this . $childProcess . spawnFromEvent ( "xcodebuild" , args , "exit" ,
265
281
{ stdio : buildConfig . buildOutputStdio || 'inherit' , cwd : this . getPlatformData ( projectData ) . projectRoot } ,
@@ -1331,6 +1347,18 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1331
1347
this . $logger . warnWithLabel ( "The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'." ) ;
1332
1348
}
1333
1349
}
1350
+
1351
+ private getExportOptionsMethod ( projectData : IProjectData ) : string {
1352
+ const embeddedMobileProvisionPath = path . join ( this . getPlatformData ( projectData ) . deviceBuildOutputPath , `${ projectData . projectName } .app` , "embedded.mobileprovision" ) ;
1353
+ const provision = mobileprovision . provision . readFromFile ( embeddedMobileProvisionPath ) ;
1354
+
1355
+ return {
1356
+ "Development" : "development" ,
1357
+ "AdHoc" : "ad-hoc" ,
1358
+ "Distribution" : "app-store" ,
1359
+ "Enterprise" : "enterprise"
1360
+ } [ provision . Type ] ;
1361
+ }
1334
1362
}
1335
1363
1336
1364
$injector . register ( "iOSProjectService" , IOSProjectService ) ;
0 commit comments