Open
Conversation
- Add --text option: find element by AXLabel/AXValue (case-insensitive partial match) via live UI tree query - Add --type/--index options: find element by type with optional 0-based index among matches - Both tap and fill now support 4 target modes: -x/-y, --ref, --text, --type (mutually exclusive via clap conflicts) - Fill --target for text-based element search, --type/--index for type - Add find_by_text() and find_by_type_index() to snapshot module - resolve_live_element() helper queries idb describe-all on the fly
Add era session connect/list/disconnect/disconnect-all commands. Sessions store UDID, device name, and auto-detected scale factor in ~/.era/sessions.json. Existing commands (tap, snapshot, fill, swipe, tap-region) gain --session option as alternative to --device. When neither is specified, the default session is used.
…tor-session # Conflicts: # src/cli/mod.rs # tests/regression.rs
Add `era mcp` command that starts a JSON-RPC stdio server implementing the Model Context Protocol. Exposes 8 tools for iOS Simulator automation: - ios_session_connect: connect to simulator with auto-scale detection - ios_list_devices: list available simulators - ios_snapshot: ref-numbered UI tree (Playwright-style) - ios_tap: tap by ref, text, type, or coordinates - ios_fill: focus text field and input text - ios_swipe: swipe by direction shortcut or coordinates - ios_screenshot: capture as base64 or file - ios_assert: verify UI state (visible/not_visible text checks) Architecture: - src/mcp/protocol.rs: JSON-RPC 2.0 + MCP type definitions - src/mcp/tools.rs: tool schema definitions (8 tools) - src/mcp/handlers.rs: tool dispatch to existing simulator operations - src/mcp/transport.rs: stdio read/write loop with lifecycle handling All existing simulator/ modules reused without modification. 210 tests passing (105 unit + 105 integration).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
era mcpios_session_connect,ios_list_devices,ios_snapshot,ios_tap,ios_fill,ios_swipe,ios_screenshot,ios_assertChanges
New
src/mcp/module (+1,359 lines)protocol.rs: JSON-RPC 2.0 + MCP type definitions (request/response/content/error)tools.rs: 8 tool schema definitions with JSON Schema input validation (6 tests)handlers.rs: Tool handlers that directly call existingsimulator/module functionstransport.rs: stdin/stdout JSON-RPC loop with MCP protocol handling (8 tests)Tool highlights
ios_snapshotreturns Playwright-style ref-numbered UI tree (token-efficient, no screenshots needed)ios_tapsupports 4 selector modes: ref / text / type+index / coordinatesios_swipeadds direction shortcuts (up/down/left/right)ios_screenshotreturns base64 PNG via MCP image content typeios_assertchecks visible/not_visible text arraysConfiguration
{ "mcpServers": { "era": { "command": "era", "args": ["mcp"] } } }Dependencies
base64 = "0.22"(screenshot encoding only)Test plan