MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / boot_simLogic

Function boot_simLogic

src/mcp/tools/simulator/boot_sim.ts:123–161  ·  view source on GitHub ↗
(
  params: BootSimParams,
  executor: CommandExecutor,
)

Source from the content-addressed store, hash-verified

121}
122
123export async function boot_simLogic(
124 params: BootSimParams,
125 executor: CommandExecutor,
126): Promise<void> {
127 const ctx = getHandlerContext();
128 const simulatorResult = await determineSimulatorUuid(params, executor);
129 if (simulatorResult.error || !simulatorResult.uuid) {
130 const result = createBootSimResult({
131 didError: true,
132 error: 'Boot simulator operation failed.',
133 diagnosticMessage: `Failed to resolve simulator: ${simulatorResult.error ?? 'No simulator UUID returned'}`,
134 });
135 setStructuredOutput(ctx, result);
136 log('error', `Error during boot simulator operation: ${result.error ?? 'Unknown error'}`);
137 return;
138 }
139
140 if (simulatorResult.warning) {
141 log('warn', simulatorResult.warning);
142 }
143
144 const resolvedParams: ResolvedBootSimParams = { ...params, simulatorId: simulatorResult.uuid };
145 log('info', `Starting xcrun simctl boot request for simulator ${resolvedParams.simulatorId}`);
146
147 const executeBootSim = createBootSimExecutor(executor);
148 const result = await executeBootSim(resolvedParams);
149 setStructuredOutput(ctx, result);
150
151 if (result.didError) {
152 log('error', `Error during boot simulator operation: ${result.error ?? 'Unknown error'}`);
153 return;
154 }
155
156 ctx.nextStepParams = {
157 open_sim: {},
158 install_app_sim: { simulatorId: resolvedParams.simulatorId, appPath: 'PATH_TO_YOUR_APP' },
159 launch_app_sim: { simulatorId: resolvedParams.simulatorId, bundleId: 'YOUR_APP_BUNDLE_ID' },
160 };
161}
162
163export const schema = getSessionAwareToolSchemaShape({
164 sessionAware: publicSchemaObject,

Callers 1

boot_sim.test.tsFile · 0.90

Calls 6

getHandlerContextFunction · 0.90
determineSimulatorUuidFunction · 0.90
logFunction · 0.90
createBootSimResultFunction · 0.85
createBootSimExecutorFunction · 0.85
setStructuredOutputFunction · 0.70

Tested by

no test coverage detected