Skip to content

Add iOS physical device support, update WDA, and refactor platform code - #1

Merged
omnarayan merged 4 commits into
devicelab-dev:mainfrom
nagavenkateshsankar:main
Jan 30, 2026
Merged

Add iOS physical device support, update WDA, and refactor platform code#1
omnarayan merged 4 commits into
devicelab-dev:mainfrom
nagavenkateshsankar:main

Conversation

@nagavenkateshsankar

Copy link
Copy Markdown
Collaborator

Summary

  • Add support for physical iOS devices (detection, app installation, device info)
  • Update WebDriverAgent to v11.1.3 for Xcode 17/iOS 26 compatibility
  • Add WDA management CLI commands
  • Fix iOS simulator name detection bug
  • Refactor platform-specific code to separate files

Changes

Commit Description
8ba97bc Add physical iOS device support - Auto-detect via idevice_id, install apps via ios-deploy, get device info via ideviceinfo
2362eda Update WDA to v11.1.3 - Xcode 17/iOS 26 compatibility, add wda version and wda update CLI commands
6348f9e Fix iOS simulator name detection - Replace line-by-line parsing with proper JSON parsing in getSimulatorInfo
61d8d56 Refactor platform code - Extract iOS (435 lines) and Android (218 lines) to separate files, reduce test.go from ~2003 to 1375 lines

Files Changed

  • pkg/cli/test.go - Reduced from ~2003 to 1375 lines
  • pkg/cli/ios.go - New: iOS driver and device functions
  • pkg/cli/android.go - New: Android driver functions
  • pkg/cli/wda.go - New: WDA management commands
  • pkg/driver/wda/setup.go - WDA download/update logic

Test plan

  • Test iOS simulator detection and test execution
  • Test iOS physical device detection and test execution
  • Test maestro-runner wda version command
  • Test maestro-runner wda update --check command
  • Test Android device test execution

- Add device type detection (simulator vs physical device)
- Add app installation branching (simctl for simulators, ios-deploy for devices)
- Add device discovery for both simulators and connected physical devices
- Add iproxy port forwarding for physical device WDA communication
- Rename WebDriverAgent folder to version-agnostic path
- Update WDA from v8.0.0 to v11.1.3 for Xcode 17/iOS 26 compatibility
- Add wda subcommand for managing WebDriverAgent:
  - wda version: show current version
  - wda update: update to latest version
  - wda update <version>: update to specific version
  - wda update --check: check if update available
- Setup() now auto-downloads WDA if missing
- Add version detection from package.json and GitHub API
The previous line-by-line string parsing was incorrectly matching
the UDID in the dataPath field instead of the udid field, causing
wrong device names to be returned (e.g., "iPhone Air" instead of
"iPhone 17").

Fixed by using proper JSON parsing of simctl output to correctly
match devices by their UDID field and extract the name directly.
Move iOS and Android driver functions to dedicated files for better organization:
- ios.go: iOS driver, simulator detection, device info, app installation
- android.go: Android driver, UIAutomator2 setup, device detection

Also removes unused WDADir constant and GetWDABasePath() from setup.go.
@omnarayan
omnarayan merged commit e120a92 into devicelab-dev:main Jan 30, 2026
omnarayan added a commit that referenced this pull request Feb 1, 2026
Add iOS physical device support, update WDA, and refactor platform code
omnarayan added a commit that referenced this pull request May 14, 2026
Lets the browser driver reuse a user-data-dir across runs so cookies,
localStorage, sessionStorage, and installed extensions survive between
test invocations. Useful for:
  - speeding up auth-heavy CI suites (log in once, reuse across flows)
  - testing flows that depend on installed Chrome extensions
  - keeping a stable browser profile for cookie-driven behaviour

Usage:

  maestro-runner --platform web --user-data-dir ~/.cache/mr-profile \
    test flow.yaml

Also exposed via MAESTRO_USER_DATA_DIR for shell-driven CI configuration.
Default unset → identical to current ephemeral-profile behaviour (no
backward-compat risk).

Implementation:
  - cdpdriver.Config gains UserDataDir field.
  - When non-empty, passed to Rod's launcher as `user-data-dir=<path>`.
    Existing prefs-file write (writeChromePref) already handled this dir,
    so password-manager disabling still works on persistent profiles.
  - CLI plumbing: --user-data-dir flag → RunConfig.UserDataDir → web.go
    construction.
  - Caller manages the directory's lifecycle (the runner doesn't create
    or clean it up).

Tests:
  - TestUserDataDir — end-to-end persistence: two New() calls against
    the same dir, localStorage written in run #1, read back in run #2.
    Uses manually-managed temp dir because t.TempDir() races Chrome's
    lock-file release on macOS.

Real-flow verification:
  - Two `maestro-runner test` invocations against `--user-data-dir
    /tmp/profile` and a real http://localhost origin (data: URLs disable
    localStorage). First flow writes; second reads back the value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants