From 29b5752e443616dde7b545ab07ae732cb4d11081 Mon Sep 17 00:00:00 2001 From: PJ Date: Sat, 6 Jun 2026 23:47:00 +0530 Subject: [PATCH] fix(doctor): probe simctl via xcrun instead of PATH lookup --- cmd/sanderling/doctor.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/sanderling/doctor.go b/cmd/sanderling/doctor.go index e5433bf..40072ce 100644 --- a/cmd/sanderling/doctor.go +++ b/cmd/sanderling/doctor.go @@ -64,7 +64,7 @@ func androidChecks() []doctorCheck { func iosChecks() []doctorCheck { return []doctorCheck{ {Name: "xcrun on PATH (ios simulator)", Run: checkExecutableOnPath("xcrun")}, - {Name: "simctl on PATH (ios simulator)", Run: checkExecutableOnPath("simctl")}, + {Name: "simctl available (ios simulator)", Run: checkSimctl}, } } @@ -111,6 +111,15 @@ func checkChromiumLaunch(ctx context.Context) error { return nil } +// checkSimctl exercises `xcrun simctl help`: simctl is an xcrun subcommand, +// not a standalone binary, so a PATH lookup can never find it. +func checkSimctl(ctx context.Context) error { + if err := exec.CommandContext(ctx, "xcrun", "simctl", "help").Run(); err != nil { + return fmt.Errorf("xcrun simctl help: %w", err) + } + return nil +} + func checkSidecarJAR(_ context.Context) error { if sidecarassets.IsPlaceholder() { return fmt.Errorf("placeholder JAR embedded; run `make sidecar && make sanderling` to embed the real fat JAR")