MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / prepareTestSimExecution

Function prepareTestSimExecution

src/mcp/tools/simulator/test_sim.ts:103–188  ·  view source on GitHub ↗
(
  params: TestSimulatorParams,
  executor: CommandExecutor,
  fileSystemExecutor: FileSystemExecutor,
)

Source from the content-addressed store, hash-verified

101}
102
103async function prepareTestSimExecution(
104 params: TestSimulatorParams,
105 executor: CommandExecutor,
106 fileSystemExecutor: FileSystemExecutor,
107): Promise<PreparedTestSimExecution> {
108 const configuration = params.configuration ?? 'Debug';
109 const inferred = await inferPlatform(
110 {
111 projectPath: params.projectPath,
112 workspacePath: params.workspacePath,
113 scheme: params.scheme,
114 simulatorId: params.simulatorId,
115 simulatorName: params.simulatorName,
116 },
117 executor,
118 );
119
120 log(
121 'info',
122 `Inferred simulator platform for tests: ${inferred.platform} (source: ${inferred.source})`,
123 );
124
125 const simulatorResolution = await resolveSimulatorIdOrName(
126 executor,
127 params.simulatorId,
128 params.simulatorName,
129 );
130
131 if (!simulatorResolution.success) {
132 return {
133 configuration,
134 platform: inferred.platform,
135 resolutionError: simulatorResolution.error,
136 invocationRequest: {
137 scheme: params.scheme,
138 workspacePath: params.workspacePath,
139 projectPath: params.projectPath,
140 derivedDataPath: resolveEffectiveDerivedDataPath(params),
141 configuration,
142 platform: inferred.platform,
143 simulatorName: params.simulatorName,
144 simulatorId: params.simulatorId,
145 },
146 warningMessage:
147 params.simulatorId && params.useLatestOS !== undefined
148 ? 'useLatestOS parameter is ignored when using simulatorId (UUID implies exact device/OS)'
149 : undefined,
150 };
151 }
152
153 const destinationName = params.simulatorName ?? simulatorResolution.simulatorName;
154 const preflight = await resolveTestPreflight(
155 {
156 projectPath: params.projectPath,
157 workspacePath: params.workspacePath,
158 scheme: params.scheme,
159 configuration,
160 extraArgs: params.extraArgs,

Callers 2

createTestSimExecutorFunction · 0.85
test_simLogicFunction · 0.85

Calls 5

inferPlatformFunction · 0.90
logFunction · 0.90
resolveSimulatorIdOrNameFunction · 0.90
resolveTestPreflightFunction · 0.90

Tested by

no test coverage detected