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")