Remap Fire TV remote keys to launch specific applications using ADB
/usr/bin/sh firetv-remapper.sh <KEY_EVENT> <APP_PACKAGE>/usr/bin/sh firetv-remapper.sh "KEYCODE_APP_3" "org.xbmc.kodi/.Splash"- Go to Settings > My Fire TV > Developer Options.
- Enable ADB Debugging.
- Find the Fire TV IP address under Settings > Network.
Run the following command from your computer:
adb connect <FIRE_TV_IP>adb push firetv-remapper.sh /sdcard/
adb shell "sh /sdcard/firetv-remapper.sh"To launch a different app, find its package name using:
adb shell pm list packages | grep <app_name>To get the full launcher activity, run:
adb shell dumpsys package <package_name> | grep -A 10 MAINFor example, to launch VLC:
adb shell am start -n org.videolan.vlc/.gui.MainActivityTo find key events for Fire TV remote buttons, use:
adb shell getevent -lPress the desired button on your Fire TV remote and look for a key code like:
KEY_746
Alternatively, check system logs:
adb shell logcat -v brief | grep "KEYCODE"adb shell sh /sdcard/firetv-remapper.sh KEYCODE_MEDIA_PLAY org.videolan.vlc/.gui.MainActivityadb shell sh /sdcard/firetv-remapper.sh KEYCODE_HOME com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivityadb shell sh /sdcard/firetv-remapper.sh KEYCODE_PROG_RED com.netflix.ninja/.MainActivity