Skip to content

Android: plug in a hardware keyboard for one session #4786

Open

Description

@V3RON

Problem

Android emulators have no hardware keyboard (hw.keyboard=no). Tests that need one cannot run: physical-keyboard text entry, keyboard shortcuts, tablet layouts with the on-screen keyboard hidden.

Changing hw.keyboard in config.ini applies to every emulator on the machine and needs a new snapshot. See callstackincubator/simlock#1082.

Proposal

Add a per-session hardware keyboard for Android:

  1. Register a virtual USB keyboard with adb shell hid (a register command carrying a boot-keyboard HID descriptor). am get-config then reports qwerty.
  2. Optional: hide the on-screen keyboard with settings put secure show_ime_with_hard_keyboard 0, and restore the old value afterwards.
  3. Unplug the keyboard when the session ends by ending the hid process.

Tested on Android 35 with hw.keyboard=no: keys typed into the focused field, Shift included. No reboot and no new snapshot were needed.

Written by an agent.

Activity

  1. added
    enhancement
    on Nov 21, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions