Skip to content

Debloat your Android TV, install apps, browse and transfer files on it, all from your phone. Just 3 MB, no tracking, no root, no PC.

Open apps on Fire TV: skip monkey's system-key check

jesse-agent-821e751011e1740
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3de06fb..1c7fc96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@ until this file has a section for its version.
## Unreleased
+- **Fixed:** On Fire TV, Remote buttons and Apps › Open now open the app. [#248](../../pull/248)
+
## 0.13.0 — 2026-10-29
- **Improved:** The Remote's dock is refined: it shows only the streaming buttons you pick. [#224](../../pull/224)
diff --git a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
index 76962ac..a6d7bde 100644
--- a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
+++ b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
@@ -291,14 +291,15 @@ class Actions(private val shell: AdbShell) {
/**
* TV apps register under LEANBACK_LAUNCHER only; phone-style apps under LAUNCHER. Try both, then
- * HOME, for a launcher with no icon of its own.
+ * HOME, for a launcher with no icon of its own. `--pct-syskeys 0` because monkey aborts before
+ * launching on a TV whose remote has no keys it counts as system keys (Fire TV, exit -5).
*/
private suspend fun open(pkg: String): ActionResult {
require(PACKAGE.matches(pkg)) { "not a package name: $pkg" }
var last = ""
for (category in listOf("android.intent.category.LEANBACK_LAUNCHER", "android.intent.category.LAUNCHER", "android.intent.category.HOME")) {
require(CATEGORY.matches(category)) { "not an intent category: $category" } // both go into the shell line
- val r = shell.shell("monkey -p $pkg -c $category 1 2>&1")
+ val r = shell.shell("monkey -p $pkg -c $category --pct-syskeys 0 1 2>&1")
if (r.exitCode == 0 && "No activities found" !in r.output && "aborted" !in r.output) {
return ActionResult.Done(undo = null)
}
diff --git a/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt b/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
index d999108..0a23123 100644
--- a/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
+++ b/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
@@ -204,6 +204,12 @@ class ActionsTest {
assertEquals(2, sh.ran.count { it.startsWith("monkey") })
}
+ @Test fun openSkipsSystemKeysForAFireTvRemote() = runTest {
+ val sh = FakeShell()
+ Actions(sh).run(Action.OPEN, "com.foo")
+ assertTrue(sh.ran.single().contains("--pct-syskeys 0"))
+ }
+
@Test fun openFallsBackToHomeForALauncherWithNoIcon() = runTest {
val none = ok("** No activities found to run, monkey aborted.\n")
val sh = FakeShell(mapOf(