Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 executableFolderPath to run app name in iOS 14.0 #1236

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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