Android TV – How to simulate remote control actions without a remote
by Riley MacDonald, August 28, 2017

While working on an application for Android TV devices I realized the buttons on the remotes varies between devices. For example; some remotes include a “mute” button while others don’t. The Android Studio d-pad simulator for the emulator also doesn’t include this button (and in some cases the buttons register as UNKNOWN). How am I supposed to verify my application works correctly for all buttons?

You can simulate remote control actions even if you don’t have a physical remote. You need to have the device successfully connected via ADB to continue. While your device is connected you can send simulated remote control input using the following command:

$ adb shell input keyevent [keycode]

Alternatively you can shell into the device using adb shell and enter shorter commands: input keyevent [keycode].

[keycode] represents the button you’re trying to simulate. The KeyCodes are defined in See the documentation for the full list of available inputs.

Here’s a few examples of common inputs I used for Android TV:

$ adb shell input keyevent 19
$ adb shell input keyevent 20
$ adb shell input keyevent 21
$ adb shell input keyevent 22
$ adb shell input keyevent 85
$ adb shell input keyevent 90
$ adb shell input keyevent 89
$ adb shell input keyevent 91
Open the comment form

Leave a comment:

Comments will be reviewed before they are posted.

User Comments:

Be the first to leave a comment on this post!