Skip to content

Commit 22a770b

Browse files
committed
fix: apply code review suggestions
1 parent 8ad239d commit 22a770b

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

packages/cli-platform-apple/src/commands/runCommand/getBuildPath.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export async function getBuildPath(
2323
throw new CLIError('Failed to get product name.');
2424
}
2525

26-
if (platform === 'macos') {
27-
return path.join(targetBuildDir, fullProductName);
28-
} else if (isCatalyst) {
26+
if (isCatalyst) {
2927
return path.join(targetBuildDir, '-maccatalyst', executableFolderPath);
28+
} else if (platform === 'macos') {
29+
return path.join(targetBuildDir, fullProductName);
3030
} else {
3131
return path.join(targetBuildDir, executableFolderPath);
3232
}

packages/cli-platform-apple/src/commands/runCommand/installApp.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,27 @@ export default async function installApp({
7373
});
7474
}
7575

76-
const bundleID = child_process
77-
.execFileSync(
78-
'/usr/libexec/PlistBuddy',
79-
[
80-
'-c',
81-
'Print:CFBundleIdentifier',
82-
path.join(targetBuildDir, infoPlistPath),
83-
],
84-
{encoding: 'utf8'},
85-
)
86-
.trim();
87-
88-
logger.info(`Launching "${chalk.bold(bundleID)}"`);
89-
9076
if (platform === 'macos') {
91-
child_process.exec(
92-
`open -b ${bundleID} -a "${appPath}"`,
93-
(error, _, stderr) => {
94-
handleLaunchResult(!error, 'Failed to launch the app', stderr);
95-
},
96-
);
77+
logger.info(`Launching "${chalk.bold(appPath)}"`);
78+
79+
child_process.exec(`open "${appPath}"`, (error, _, stderr) => {
80+
handleLaunchResult(!error, 'Failed to launch the app', stderr);
81+
});
9782
} else if (udid) {
83+
const bundleID = child_process
84+
.execFileSync(
85+
'/usr/libexec/PlistBuddy',
86+
[
87+
'-c',
88+
'Print:CFBundleIdentifier',
89+
path.join(targetBuildDir, infoPlistPath),
90+
],
91+
{encoding: 'utf8'},
92+
)
93+
.trim();
94+
95+
logger.info(`Launching "${chalk.bold(bundleID)}"`);
96+
9897
let result = child_process.spawnSync('xcrun', [
9998
'simctl',
10099
'launch',

0 commit comments

Comments
 (0)