Skip to content

io text / io keys silently no-op on iOS simulator (return success, text never entered) #447

Description

@julyzd

Bug report: io text / io keys silently no-op on iOS simulator (return success, text never entered)

Summary

On an iOS simulator, mobilecli io text (and io keys, and clipboard+paste) all return
{"status":"ok"} but the text is never actually entered into the focused field.
Tap, dump ui, screenshot, and app management all work correctly through the same agent —
only the keyboard/input event path is broken.

Touch on the same device with mobilecli io text does NOT exhibit this (works via adb shell input text).

Environment

Component Version
OS macOS 26.6.2 (Build 25G83), arm64 (Apple Silicon)
Xcode 16.4 (Build 16F6)
iOS Simulator iPhone 16 Pro, iOS 18.3 (UDID 94219FAA-B2B7-4DD8-9533-785904B91B05)
mobilecli 1.0.9 (@mobilenext/mobilecli-darwin-arm64)
mobile-mcp 0.0.1
on-device agent com.mobilenext.devicekit-iosUITests.xctrunner v0.0.26
Node v24.13.1

Agent is installed and healthy:

$ mobilecli agent status --device 94219FAA-... 
{ "status": "ok", "data": { "message": "Agent version 0.0.26 is installed on device", ... } }

Reproduction

I built a minimal UIKit app (one UITextField with accessibilityIdentifier = "username_field",
launched at the top of a form) and installed it on the simulator.

  1. Dump the UI — the field is visible with a ref:
$ mobilecli dump ui --device <id> --format text
...
@e2 TextField name="username_field" id="username_field" at=122,543 size=240x34
...
  1. Tap to focus — the software keyboard appears, confirming the field is first responder:
$ mobilecli io tap @e2 --device <id>
{ "status": "ok", "data": { "message": "Tapped on device ... at (242,560)" } }
  1. Send text — reports success:
$ mobilecli io text "Alice" --device <id>
{ "status": "ok", "data": { "message": "Sent text to device ..." } }
  1. Re-dump the UI — the field is still empty:
{ "ref":"@e2", "type":"TextField", "name":"username_field",
  "placeholder":"Username", "identifier":"username_field",
  "rect":{"x":122,"y":543,"width":240,"height":34} }

Expected behavior

After step 3, the dump should show "value": "Alice" on the username_field element.

Actual behavior

io text (and every other input route below) returns success but the field's value
never appears and no characters are visible on screen.

Additional input routes that also fail

Each returns {"status":"ok"} but leaves the field empty:

Attempt Command Result
Per-key input mobilecli io keys a b c --device <id> no-op, field empty
Clipboard + paste mobilecli io clipboard set "Alice" then mobilecli io keys cmd+v no-op, field empty
Single key mobilecli io keys a no-op

Things I ruled out

  • "Connect Hardware Keyboard" — disabled it and rebooted the simulator
    (defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false,
    then simctl shutdown + simctl boot). The software keyboard now appears on tap
    (i.e. focus works), but text input still never lands in the field.
  • Ref freshness — refs were re-dumped immediately before reuse; tap landed on the
    correct center coordinate (242,560), confirmed both by the tap response and by the
    soft keyboard appearing.
  • Focus — the soft keyboard appearing proves UITextField became first responder.
  • MCP layer — mobile_type_keys (mobile-mcp) just forwards to mobilecli io text,
    so this reproduces with mobilecli invoked directly, bypassing the MCP server entirely.

Hypothesis

The devicekit agent (0.0.26) keyboard/text event path is a no-op on iOS 18.x simulators
(XCUITest typeText/keyboard focus probably not resolving the focused element), while
tap / dump ui / screenshot through the same agent work fine. The CLI returning
"Sent text …" without verifying the field actually received it masks the failure.

Impact

Native app form filling and any text-driven automation is unusable on iOS simulators
(mobile_type_keys in mobile-mcp is affected by the same root cause).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions