Skip to content

Commit 5947f85

Browse files
committed
fix(cordova): use the Xcode configuration-based iOS build output paths
cordova-ios stopped writing to platforms/ios/build/emulator and platforms/ios/build/device; the products land in configuration-named directories instead, so the CLI looked for the .app and .ipa where they no longer are. Derive the path from the release flag: build/Debug-iphonesimulator/<app>.app build/Release-iphoneos/<app>.ipa Submitted upstream as ionic-team#5079.
1 parent 54a76b5 commit 5947f85

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • packages/@ionic/cli/src/lib/integrations/cordova

packages/@ionic/cli/src/lib/integrations/cordova/project.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { FatalException } from '../../errors';
1111
const debug = Debug('ionic:lib:cordova:project');
1212

1313
const CORDOVA_ANDROID_PACKAGE_PATH = 'platforms/android/app/build/outputs/apk/';
14-
const CORDOVA_IOS_SIMULATOR_PACKAGE_PATH = 'platforms/ios/build/emulator';
15-
const CORDOVA_IOS_DEVICE_PACKAGE_PATH = 'platforms/ios/build/device';
14+
const CORDOVA_IOS_PACKAGE_PATH = 'platforms/ios/build';
1615

1716
export async function getPlatforms(projectDir: string): Promise<string[]> {
1817
const platformsDir = path.resolve(projectDir, 'platforms');
@@ -74,11 +73,12 @@ export async function getPackagePath(root: string, appName: string, platform: st
7473
if (platform === 'android') {
7574
return getAndroidPackageFilePath(root, { emulator, release });
7675
} else if (platform === 'ios') {
76+
const configuration = release ? 'Release' : 'Debug';
7777
if (emulator) {
78-
return path.join(CORDOVA_IOS_SIMULATOR_PACKAGE_PATH, `${appName}.app`);
78+
return path.join(CORDOVA_IOS_PACKAGE_PATH, `${configuration}-iphonesimulator`, `${appName}.app`);
7979
}
8080

81-
return path.join(CORDOVA_IOS_DEVICE_PACKAGE_PATH, `${appName}.ipa`);
81+
return path.join(CORDOVA_IOS_PACKAGE_PATH, `${configuration}-iphoneos` , `${appName}.ipa`);
8282
}
8383

8484
throw new FatalException(`Unknown package path for ${input(appName)} on ${input(platform)}.`);

0 commit comments

Comments
 (0)