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

Function inferPlatformFromSimulatorName

src/utils/infer-platform.ts:38–56  ·  view source on GitHub ↗
(simulatorName: string)

Source from the content-addressed store, hash-verified

36const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
37
38function inferPlatformFromSimulatorName(simulatorName: string): SimulatorPlatform | null {
39 const name = simulatorName.toLowerCase();
40
41 if (name.includes('watch')) return XcodePlatform.watchOSSimulator;
42 if (name.includes('apple tv') || name.includes('tvos')) return XcodePlatform.tvOSSimulator;
43 if (
44 name.includes('apple vision') ||
45 name.includes('vision pro') ||
46 name.includes('visionos') ||
47 name.includes('xros')
48 ) {
49 return XcodePlatform.visionOSSimulator;
50 }
51 if (name.includes('iphone') || name.includes('ipad') || name.includes('ipod')) {
52 return XcodePlatform.iOSSimulator;
53 }
54
55 return null;
56}
57
58function inferPlatformFromRuntime(runtime: string): SimulatorPlatform | null {
59 const value = runtime.toLowerCase();

Callers 1

inferPlatformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected