Skip to content

Commit

Permalink
fix: 🐛 executableFolderPath to run app name in iOS 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oeduardoal committed Aug 2, 2020
1 parent f76add9 commit d502f13
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/platform-ios/src/commands/runIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,22 @@ function bootSimulator(selectedSimulator: Device) {
}
}

function getTargetBuildDir(buildSettings: string) {
function getTargetPaths(buildSettings: string) {
const settings = JSON.parse(buildSettings);

// Find app in all building settings - look for WRAPPER_EXTENSION: 'app',
for (const i in settings) {
const wrapperExtension = settings[i].buildSettings.WRAPPER_EXTENSION;

if (wrapperExtension === 'app') {
return settings[i].buildSettings.TARGET_BUILD_DIR;
return {
targetBuildDir: settings[i].buildSettings.TARGET_BUILD_DIR,
executableFolderPath: settings[i].buildSettings.EXECUTABLE_FOLDER_PATH,
}
}
}

return null;
return {};
}

function getBuildPath(
Expand Down Expand Up @@ -420,12 +424,17 @@ function getBuildPath(
],
{encoding: 'utf8'},
);
const targetBuildDir = getTargetBuildDir(buildSettings);
const { targetBuildDir, executableFolderPath } = getTargetPaths(buildSettings);

if (!targetBuildDir) {
throw new CLIError('Failed to get the target build directory.');
}

return `${targetBuildDir}/${appName}.app`;
if (!executableFolderPath) {
throw new CLIError('Failed to get the app name.');
}

return `${targetBuildDir}/${executableFolderPath}`;
}

function getProductName(buildOutput: string) {
Expand Down

0 comments on commit d502f13

Please sign in to comment.