Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Maestro `eraseText` fails on real Android devices: `test` and `replay` cannot opt in to the test IME

未关闭
#2,997 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
74/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
android, typescript
领域
cli, mobile, testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

ready-for-agent

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:

https://github.com/callstack/agent-device/blob/16e07572ab28227563fd76ab062cb375c4b7e1db/packages/maestro/src/daemon-port/daemon-runtime-port.ts#L262-L265

Backspace is a control character, so it needs the test IME. On real devices the test IME is opt-in through open --test-ime:

https://github.com/callstack/agent-device/blob/16e07572ab28227563fd76ab062cb375c4b7e1db/src/daemon/session-lifecycle/internal/session-open-execution.ts#L128-L134

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>, then test --session <name>: fails at launchApp with android device <serial> is owned by session "<name>"
  • same with replay --maestro --session <name>: same error
  • {"testIme": true} in a config file passed through AGENT_DEVICE_CONFIG: test still fails with the error above
  • adb shell ime set to the helper before test: 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-ime on test and replay
  • or testIme from agent-device.json for flow runs

Environment

  • agent-device 0.21.14. Same gating in 0.21.15 and on main at 16e0757
  • Pixel 8, Android 17, USB
  • macOS host
主要语言
TypeScript
星标
4.7k
派生
304
平均合并
11 小时 25 分钟
30 天内合并 PR
545

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。