Skip to content

Commit 815f0a9

Browse files
PeterStaevrosen-vladimirov
authored andcommitted
Fix IPA export (#3036)
* fixes #3020 * changes requested from review * require new version of ios-mobileprovision-finder module * Update shrinkwrap, so ios-mobileprovision-finder 1.0.10 will be used
1 parent 1a7e27d commit 815f0a9

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

lib/services/ios-project-service.ts

+29-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
251251
let projectRoot = platformData.projectRoot;
252252
let archivePath = options.archivePath;
253253
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);
254270

255271
// The xcodebuild exportPath expects directory and writes the <project-name>.ipa at that directory.
256272
let exportPath = path.resolve(options.exportDir || buildOutputPath);
@@ -259,7 +275,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
259275
let args = ["-exportArchive",
260276
"-archivePath", archivePath,
261277
"-exportPath", exportPath,
262-
"-exportOptionsPlist", platformData.configurationFilePath
278+
"-exportOptionsPlist", exportOptionsPlist
263279
];
264280
await this.$childProcess.spawnFromEvent("xcodebuild", args, "exit",
265281
{ 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
13311347
this.$logger.warnWithLabel("The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'.");
13321348
}
13331349
}
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+
}
13341362
}
13351363

13361364
$injector.register("iOSProjectService", IOSProjectService);

npm-shrinkwrap.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"iconv-lite": "0.4.11",
4545
"inquirer": "0.9.0",
4646
"ios-device-lib": "0.4.8",
47-
"ios-mobileprovision-finder": "1.0.9",
47+
"ios-mobileprovision-finder": "1.0.10",
4848
"ios-sim-portable": "~3.0.0",
4949
"lockfile": "1.0.1",
5050
"lodash": "4.13.1",

0 commit comments

Comments
 (0)