fix(doctor): probe simctl via xcrun instead of PATH lookup

This commit is contained in:
pj committed 2026-06-06 23:47:00 +05:30
1 parent 34cfba4221
commit 29b5752e44
1 file changed
+10 -1
+10 -1
View File
@@ -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")