Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 14 additions & 3 deletions packages/plugin-platform-apple/src/lib/commands/run/installApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ApplePlatform, XcodeProjectInfo } from '../../types/index.js';
import spawn, { SubprocessError } from 'nano-spawn';

type Options = {
buildOutput: string;
xcodeProject: XcodeProjectInfo;
sourceDir: string;
mode: string;
Expand All @@ -18,7 +17,6 @@ type Options = {
};

export default async function installApp({
buildOutput,
xcodeProject,
sourceDir,
mode,
Expand All @@ -34,7 +32,7 @@ export default async function installApp({
xcodeProject,
sourceDir,
mode,
buildOutput,
`export PLATFORM_NAME=${getPlatformSDK(platform)}`, // simulate build output
scheme,
target
);
Expand Down Expand Up @@ -86,3 +84,16 @@ export default async function installApp({
throw error;
}
}

function getPlatformSDK(platform: ApplePlatform) {
switch (platform) {
case 'ios':
return 'iphonesimulator';
case 'macos':
return 'macosx';
case 'tvos':
return 'appletvsimulator';
case 'visionos':
return 'xrsimulator';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ export async function runOnSimulator(
}
loader.stop(`Launched Simulator "${simulator.name}".`);

let buildOutput;
if (!binaryPath) {
buildOutput = await buildProject(
await buildProject(
xcodeProject,
sourceDir,
platform,
Expand All @@ -58,7 +57,6 @@ export async function runOnSimulator(

loader.start(`Installing the app on "${simulator.name}"`);
await installApp({
buildOutput: buildOutput ?? '',
xcodeProject,
sourceDir,
mode,
Expand Down
Loading