feat(testrun): reject physical iOS with a clear message

This commit is contained in:
pj committed 2026-06-08 19:34:12 +05:30
1 parent d7113eea4d
commit a9fdf49a62
1 file changed
+8 -8
+8 -8
View File
@@ -21,8 +21,9 @@ import (
// buildDriver creates the appropriate DeviceDriver for the platform and returns // buildDriver creates the appropriate DeviceDriver for the platform and returns
// a cleanup function. For web, ChromeDriver is used directly. An iOS simulator // a cleanup function. For web, ChromeDriver is used directly. An iOS simulator
// is driven by the native simulator companion (no JVM). Android and physical // is driven by the native simulator companion (no JVM). Android uses the JVM
// iOS devices use the JVM sidecar, which is extracted, spawned, and dialed. // sidecar, which is extracted, spawned, and dialed. Physical iOS devices are
// not yet supported.
func buildDriver(ctx context.Context, options Options, stdout io.Writer) (driver.DeviceDriver, func(), error) { func buildDriver(ctx context.Context, options Options, stdout io.Writer) (driver.DeviceDriver, func(), error) {
if err := Preflight(ctx, options.Platform); err != nil { if err := Preflight(ctx, options.Platform); err != nil {
return nil, nil, err return nil, nil, err
@@ -45,7 +46,11 @@ func buildDriver(ctx context.Context, options Options, stdout io.Writer) (driver
return d, d.Close, nil return d, d.Close, nil
} }
// Physical iOS devices and Android use the JVM sidecar, which requires java. if options.Platform == "ios" {
return nil, nil, fmt.Errorf("physical-device iOS is not yet supported; run against a simulator instead")
}
// Android uses the JVM sidecar, which requires java.
if err := preflightDevice(options.Platform); err != nil { if err := preflightDevice(options.Platform); err != nil {
return nil, nil, err return nil, nil, err
} }
@@ -65,11 +70,6 @@ func buildDriver(ctx context.Context, options Options, stdout io.Writer) (driver
"--port", strconv.Itoa(sidecarPort), "--port", strconv.Itoa(sidecarPort),
"--platform", options.Platform, "--platform", options.Platform,
} }
if options.Platform == "ios" {
if options.iosUDID != "" {
sidecarArgs = append(sidecarArgs, "--udid", options.iosUDID)
}
}
sidecarCommand := exec.CommandContext(ctx, "java", sidecarArgs...) sidecarCommand := exec.CommandContext(ctx, "java", sidecarArgs...)
sidecarCommand.Stdout = stdout sidecarCommand.Stdout = stdout
sidecarCommand.Stderr = stdout sidecarCommand.Stderr = stdout