Maestro `eraseText` fails on real Android devices: `test` and `replay` cannot opt in to the test IME
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- android, typescript
Research direction
Start with packages/maestro/src/daemon-port/daemon-runtime-port.ts and src/daemon/session-lifecycle/internal/session-open-execution.ts, then trace the test and replay command entry points. Check how open --test-ime activates the helper and how shouldActivateAndroidTestIme handles real devices. Done means test and replay offer an opt-in, eraseText passes on real devices, and the device keyboard is restored while the default remains off.
Written by the indexing model from the issue text.
Description
Summary
On a real Android device, a Maestro flow with eraseText fails under agent-device test --maestro:
Replay failed at step 27 (eraseText): Android text input requires provider-native text injection or the bundled test IME helper for non-ASCII/control characters; the adb-shell fallback supports ASCII text only. On emulators the test IME activates automatically; on real devices pass `open --test-ime` to enable it
The same flow passes on an emulator. ASCII inputText works on the device.
Cause
eraseText types backspace characters:
Backspace is a control character, so it needs the test IME. On real devices the test IME is opt-in through open --test-ime:
test and replay have no such flag, so a flow run on a real device never gets the test IME.
What I tried
open --test-ime --session <name>, thentest --session <name>: fails atlaunchAppwithandroid device <serial> is owned by session "<name>"- same with
replay --maestro --session <name>: same error {"testIme": true}in a config file passed throughAGENT_DEVICE_CONFIG:teststill fails with the error aboveadb shell ime setto the helper beforetest: still fails with the error above
Check with the test IME on
Local patch: shouldActivateAndroidTestIme returns true for real devices. With it, a flow with eraseText passes on the device, and the device keyboard is restored after the run.
Request
An opt-in for flow runs. The real-device default stays off, as decided in #1198. For example:
--test-imeontestandreplay- or
testImefromagent-device.jsonfor flow runs
Environment
- agent-device 0.21.14. Same gating in 0.21.15 and on
mainat 16e0757 - Pixel 8, Android 17, USB
- macOS host
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 315
- Avg merge
- 11h 27m
- Merged PRs (30d)
- 556
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
callstack/agent-device#3062 ·
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
callstack/agent-device#2995 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
callstack/agent-device#3060 ·
Maintainers usually reply within 1 day
-
Android test-IME fill commits into a stale InputConnection session after focus moves to a new fieldOpen
Difficulty 3/5 1-2 days Newbie friendliness 74/100
callstack/agent-device#3052 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pingdotgg/t3code#14452 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
solana-foundation/program-examples#747 · 1 comment ·
Maintainers usually reply within 9 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
remotion-dev/remotion#11847 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openwatersio/slackwater#355 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#1998 · 3 comments ·
Maintainers usually reply within 1 day