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

Android: open leaves the real keyboard active when the test IME helper disappears while the daemon is alive

未关闭 适合新手
#3,407 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

先阅读 dist/src/ime-state.js,尤其是 ensureHelperInstalled 及其模块级缓存;追踪 open 在哪里调用它,并检查相关测试。通过以下步骤复现:打开一个 Android 应用,在 daemon 仍运行时卸载测试用 IME helper,然后再次打开应用。完成时应能重新检查 helper 是否缺失并重新安装,或者 open 发出警告或失败,而不是在真实键盘处于活动状态时报告成功。

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

描述

Summary

On Android, the daemon remembers per device that the test IME helper (com.callstack.agentdevice.imehelper) is installed, and never re-checks it during its lifetime. If the helper disappears from the device while the daemon is still alive, the next open leaves the real keyboard active and reports success, with no warning.

Reproduction

agent-device 0.21.24, Android emulator API 32, single daemon started by the first command.

npx agent-device open com.android.settings --platform android
adb shell settings get secure default_input_method   # com.callstack.agentdevice.imehelper/.TestInputMethodService
npx agent-device close

adb uninstall com.callstack.agentdevice.imehelper    # Success

npx agent-device open com.android.settings --platform android   # "Opened: com.android.settings", rc 0
adb shell settings get secure default_input_method   # com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME

With a field focused after the second open:

  • keyboard status: Keyboard visible: yes, Input method: com.google.android.inputmethod.latin
  • snapshot --json: keyboard.kind is visible

After daemon stop, the same open reinstalls the helper and selects it (TestInputMethodService, Keyboard visible: no, kind: absent).

Expected

open either reinstalls the helper when it is missing, or fails / warns that the test IME could not be selected.

Likely cause

dist/src/ime-state.js: ensureHelperInstalled is called with a module-level cache: new Set(). Once a device id is in the set, the installation is not checked again.

When it happens in practice

An AVD wiped (-wipe-data) or recreated under the same serial (emulator-5554), or the helper uninstalled, then reopened within the daemon's idle timeout (~5 min after the last close). A plain emulator restart with the helper still installed does not trigger it.

主要语言
TypeScript
星标
4.9k
派生
328
平均合并
12 小时 18 分钟
30 天内合并 PR
561

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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