feat(cli): add --ios-device flag and IosDevice option

This commit is contained in:
pj committed 2026-04-23 15:06:08 +07:00
1 parent 0ffe9f0a25
commit 4c21f4722a
2 files changed
+5 -2

No files matched your search

+4 -2
View File
@@ -19,6 +19,7 @@ type testOptions struct {
bundleID string bundleID string
platform string platform string
avd string avd string
iosDevice string
duration time.Duration duration time.Duration
seed int64 seed int64
output string output string
@@ -44,8 +45,9 @@ func parseTestArgs(args []string, stderr io.Writer) (testOptions, error) {
var options testOptions var options testOptions
flagSet.StringVar(&options.spec, "spec", "", "path to the TypeScript spec (required)") flagSet.StringVar(&options.spec, "spec", "", "path to the TypeScript spec (required)")
flagSet.StringVar(&options.bundleID, "bundle-id", "", "target app bundle ID (required)") flagSet.StringVar(&options.bundleID, "bundle-id", "", "target app bundle ID (required)")
flagSet.StringVar(&options.platform, "platform", "android", "target platform: android, web") flagSet.StringVar(&options.platform, "platform", "android", "target platform: android, ios, web")
flagSet.StringVar(&options.avd, "avd", "", "Android AVD name to boot if no device is connected") flagSet.StringVar(&options.avd, "avd", "", "Android AVD name to boot if no device is connected")
flagSet.StringVar(&options.iosDevice, "ios-device", "", "iOS simulator name or UDID to boot if none is running")
flagSet.DurationVar(&options.duration, "duration", 5*time.Minute, "total test duration") flagSet.DurationVar(&options.duration, "duration", 5*time.Minute, "total test duration")
flagSet.Int64Var(&options.seed, "seed", 0, "RNG seed (0 = random)") flagSet.Int64Var(&options.seed, "seed", 0, "RNG seed (0 = random)")
flagSet.StringVar(&options.output, "output", "./runs", "output directory for traces") flagSet.StringVar(&options.output, "output", "./runs", "output directory for traces")
@@ -61,7 +63,7 @@ func parseTestArgs(args []string, stderr io.Writer) (testOptions, error) {
switch options.platform { switch options.platform {
case "android", "ios", "web": case "android", "ios", "web":
default: default:
return testOptions{}, fmt.Errorf("unsupported platform: %q (android, web)", options.platform) return testOptions{}, fmt.Errorf("unsupported platform: %q (android, ios, web)", options.platform)
} }
return options, nil return options, nil
} }
+1
View File
@@ -13,6 +13,7 @@ func runTestPipeline(ctx context.Context, options testOptions, stdout io.Writer)
BundleID: options.bundleID, BundleID: options.bundleID,
Platform: options.platform, Platform: options.platform,
AVD: options.avd, AVD: options.avd,
IosDevice: options.iosDevice,
Duration: options.duration, Duration: options.duration,
Seed: options.seed, Seed: options.seed,
Output: options.output, Output: options.output,