Unofficial Community Tool This is not affiliated with or endorsed by mobile.dev or the Maestro project. It's a community-built stop-gap until PR #2856 is merged.
Run Maestro tests on real iOS devices.
Built by DeviceLab β stop renting devices you already own.
What It Does
- Patches your existing Maestro installation with real device support
- Builds and runs the XCTest driver on your iOS device
- Sets up port forwarding so Maestro can communicate with the device
Compatibility
| Maestro Version | Status |
|---|---|
| 2.0.10 | Supported |
| 2.0.9 | Supported |
| Other 2.x | Not tested |
| 1.x | Not supported |
Note: We build patches against specific Maestro releases. Using unsupported versions may cause issues.
Requirements
- macOS
- Maestro 2.x installed
- Xcode with command line tools
- Apple Developer account (free or paid)
- iOS device connected via USB
Installation
curl -fsSL https://devicelab.dev/open-source/install/maestro-ios-device.sh | sh
This will:
- Download the
maestro-ios-devicebinary - Download patched JARs and iOS runner
- Backup your current Maestro installation
- Patch Maestro with real device support
Verify Installation
maestro-ios-device --version
Usage
1. Start the Device Bridge
Keep this running in a terminal:
maestro-ios-device --team-id YOUR_TEAM_ID --device DEVICE_UDID
2. Run Maestro Tests
In another terminal:
maestro --driver-host-port 6001 --device DEVICE_UDID --app-file /path/to/app.ipa test flow.yaml
Finding Your Team ID
# List available teams
security find-identity -v -p codesigning | grep "Developer"
Or in Xcode: Xcode β Settings β Accounts β Select Team β Team ID
Finding Your Device UDID
# List connected devices
xcrun xctrace list devices
Or in Finder: Select your iPhone β Click device name to reveal UDID
Options
| Flag | Description |
|---|---|
--team-id |
Apple Developer Team ID (required) |
--device |
Device UDID (required) |
--driver-host-port |
Local port (default: auto from 6001) |
--uninstall |
Restore original Maestro installation |
--version |
Show version |
--help |
Show help |
How It Works
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
β Maestro ββββββΆβ maestro-ios-deviceββββββΆβ iOS Device β
β (patched) β β (port forward) β β (XCTest) β
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
:6001 :22087
- maestro-ios-device builds and installs the XCTest runner on your device
- The runner starts an HTTP server on device port 22087
- Port forwarding connects localhost:6001 β device:22087
- Patched Maestro sends commands via
--driver-host-port 6001
Limitations
Some commands have limited support on real iOS devices due to iOS restrictions:
| Command | Status | Notes |
|---|---|---|
clearState |
Works | Reinstalls app (requires --app-file) |
setLocation |
Limited | Requires additional setup |
addMedia |
Not supported | iOS restriction |
Note: The
--app-fileflag is required for real device testing.
Uninstallation
Restore your original Maestro installation:
maestro-ios-device --uninstall
Or manually:
cp ~/.maestro/backup/* ~/.maestro/lib/
When to Stop Using This
This tool is temporary. Once PR #2856 is merged:
- Run
maestro-ios-device --uninstall - Update Maestro:
brew upgrade maestro - Use official iOS device support
We'll update this README when official support lands.
Troubleshooting
"Certificate not trusted"
On your iOS device: Settings β General β VPN & Device Management β Trust your developer certificate
Build fails
- Ensure Xcode command line tools are installed:
xcode-select --install - Open Xcode at least once to accept the license
- Check that your Apple Developer account is signed in
Device not found
- Ensure device is connected via USB
- Trust the computer on your device when prompted
- Try
xcrun xctrace list devicesto verify connection
Port already in use
# Find process using port 6001
lsof -i :6001
# Use a different port
maestro-ios-device --team-id YOUR_TEAM_ID --device DEVICE_UDID --driver-host-port 6002
XCTest runner crashes
- Ensure your device is running iOS 15+
- Check Xcode logs: Window β Devices and Simulators β View Device Logs
License
Apache 2.0 (same as Maestro)
Disclaimer
This project is not affiliated with, endorsed by, or connected to mobile.dev or the official Maestro project.
This tool patches your existing Maestro installation to add functionality not yet available in the official release.
Use at your own risk. We recommend switching to official Maestro once iOS device support is released.