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

Function inferPlatformFromRuntime

src/utils/infer-platform.ts:58–84  ·  view source on GitHub ↗
(runtime: string)

Source from the content-addressed store, hash-verified

56}
57
58function inferPlatformFromRuntime(runtime: string): SimulatorPlatform | null {
59 const value = runtime.toLowerCase();
60
61 if (value.includes('simruntime.watchos') || value.startsWith('watchos')) {
62 return XcodePlatform.watchOSSimulator;
63 }
64 if (
65 value.includes('simruntime.tvos') ||
66 value.includes('simruntime.appletv') ||
67 value.startsWith('tvos')
68 ) {
69 return XcodePlatform.tvOSSimulator;
70 }
71 if (
72 value.includes('simruntime.xros') ||
73 value.includes('simruntime.visionos') ||
74 value.startsWith('xros') ||
75 value.startsWith('visionos')
76 ) {
77 return XcodePlatform.visionOSSimulator;
78 }
79 if (value.includes('simruntime.ios') || value.startsWith('ios')) {
80 return XcodePlatform.iOSSimulator;
81 }
82
83 return null;
84}
85
86function isSimulatorPlatform(value: unknown): value is SimulatorPlatform {
87 return SIMULATOR_PLATFORMS.includes(value as SimulatorPlatform);

Callers 1

inferPlatformFromSimctlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected