Skip to content

Commit

Permalink
fix(ios): use xcodeTargetOS of 'iphoneos' for mac catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Sep 23, 2020
1 parent e533eaa commit 60220c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2473,15 +2473,19 @@ iOSBuilder.prototype.initialize = function initialize() {
this.deviceInfo = this.deviceId ? this.getDeviceInfo().udids[this.deviceId] : null;
this.xcodeTarget = /^device|simulator|macos$/.test(this.target) ? 'Debug' : 'Release';

if (this.target === 'macos' || this.target === 'dist-macappstore') {
this.xcodeTargetOS = 'maccatalyst';
} else if (this.target === 'simulator') {
if (this.target === 'simulator') {
this.xcodeTargetOS = 'iphonesimulator';
} else {
this.xcodeTargetOS = 'iphoneos';
}

this.iosBuildDir = path.join(this.buildDir, 'build', 'Products', this.xcodeTarget + '-' + this.xcodeTargetOS);
let osName = this.xcodeTargetOS;
if (this.target === 'macos' || this.target === 'dist-macappstore') {
osName = 'maccatalyst';
}
const xcodeProductName = `${this.xcodeTarget}-${osName}`;

this.iosBuildDir = path.join(this.buildDir, 'build', 'Products', xcodeProductName);
if (this.target === 'dist-appstore' || this.target === 'dist-adhoc' || this.target === 'dist-macappstore') {
this.xcodeAppDir = path.join(this.buildDir, 'ArchiveStaging');
} else if (this.target === 'macos') {
Expand Down Expand Up @@ -6661,9 +6665,8 @@ iOSBuilder.prototype.removeFiles = function removeFiles(next) {
// ignore
}

const product = `${this.xcodeTarget}-${this.xcodeTargetOS}`;
if (fs.existsSync(path.join(productsDir, product))) {
this.unmarkBuildDirFiles(path.join(productsDir, product));
if (fs.existsSync(this.iosBuildDir)) {
this.unmarkBuildDirFiles(this.iosBuildDir);
}

this.logger.info(__('Removing files'));
Expand Down

0 comments on commit 60220c7

Please sign in to comment.