feat(testrun): launch iOS app via XCTest with env vars instead of simctl

This commit is contained in:
pj committed 2026-04-23 15:49:51 +07:00
1 parent 003aba9ea2
commit bff3a49324
3 files changed
+40 -19

No files matched your search

+9
View File
@@ -69,6 +69,15 @@ func LaunchApp(ctx context.Context, bundleID string, env map[string]string) erro
return nil
}
// BootedUDID returns the UDID of the currently booted iOS simulator, or "" if none is booted.
func BootedUDID(ctx context.Context) string {
d, _ := bootedSimulator(ctx)
if d == nil {
return ""
}
return d.UDID
}
func bootedSimulator(ctx context.Context) (*simDevice, error) {
out, err := exec.CommandContext(ctx, "xcrun", "simctl", "list", "devices", "booted", "--json").Output()
if err != nil {