CleanYourTV, an MIT-licensed phone app that switches off pre-installed apps on Android TV and Google TV sets, reached the Hacker News front page on 5 December. We read its source at tag v0.4.8 (commit af98972, 3 November 2026; the same version F-Droid lists) to answer one question: what exactly does it run on the TV? The short answer: it only ever disables packages for the current user with pm disable-user --user 0, it never uninstalls anything it did not install itself, it records every change so each one can be undone, and it arms a 150-second timer on the TV that puts the stock home screen back if the phone does not confirm the switch.
The takeaway for TV app developers: streaming apps are almost never switched off by default (8 of 124 list entries), but if a user replaces the stock Google TV home, your channel rows go with it. Your app is then found only through its LEANBACK_LAUNCHER activity, so make sure that activity and its banner are right.
Why we did this: our BMDB app ships on Android TV, and we want to know how debloaters and replacement launchers treat a third-party TV app before our users run one.
This is a source review of the public repository. Every claim below links to a file and line at the v0.4.8 tag; runtime behaviour on a particular TV model is outside this post.
How it talks to the TV
The phone connects to the TV’s network debugging port, the same channel adb connect uses. The TV owner turns debugging on in the TV’s developer options; the app never switches it on by itself. The settings renderer refuses to write adb_enabled=1 (ShellRenderer.kt line 238: “never 1 from the app: the user turns debugging on from the TV”), and the end-of-session step writes settings put global adb_enabled 0 to switch it back off (line 142).
Before it plans anything, it reads the TV. The probe commands are plain shell lines in ProbeScripts.kt:
pm list packages -f # every package and its APK path
pm list packages -d # what is already disabled
dumpsys package packages # flags, versions, user 0 state
cmd package query-activities --brief \
-a android.intent.action.MAIN -c android.intent.category.HOME
cmd package query-activities --brief \
-a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHER
dumpsys tv_input; dumpsys hdmi_control
The commands that change something
Every write goes through one renderer, ShellRenderer.kt, which validates each package name against a grammar before it builds the line. We listed every operation it can produce:
| Operation | Shell line on the TV | Source |
|---|---|---|
| Switch an app off | pm disable-user --user 0 <pkg> |
line 49 |
| Put it back | pm enable --user 0 <pkg> |
line 51 |
| Back to the manifest default | pm default-state --user 0 <pkg> |
line 53 |
| Remove an app | pm uninstall --user 0 <pkg>, only for its own launcher and modules |
line 76, DefaultPlanner.kt line 848 |
| Change the home screen | cmd package set-home-activity --user 0 <component> |
line 90 |
| Debugging off at the end | settings put global adb_enabled 0 |
line 142 |
Two details matter. First, the uninstall path refuses any system package and any package the app did not install (“was not installed by this app”), so pre-installed apps are only ever disabled; their APKs stay on the TV. Second, each operation is checked after it runs: a disable is confirmed by finding the package in pm list packages -d, and the recorded prior state gives the inverse step for Undo.
Android’s own adb documentation lists the same pm disable-user [--user user_id] and pm enable commands, so anything the app does can be repeated or reversed by hand:
adb connect 192.168.1.40:5555
adb shell pm list packages -d
adb shell pm enable --user 0 com.example.tvapp
How it picks what to switch off
It does not guess. Each supported model has a community list in profile-meta.json, and the planner only touches packages that are on the TV’s list, installed, and not protected (DefaultPlanner.kt line 272). Each entry is either switched off by default or asked about first. We counted all entries at the v0.4.8 tag:

Our count of the 173 lists in CleanYourTV 0.4.8, by category.
Ads and tracking packages are switched off by default in most lists. Streaming apps are the opposite: 116 of 124 entries ask first. The eight defaults are YouTube Music on five lists and DAZN, Red Bull TV and aha on one list each. Netflix (3 lists), Prime Video (7) and Disney+ (2) are always asked about.
One thing the planner does not check: whether the factory or the owner installed a listed package. If a list names your package and the user accepts the default, it is disabled either way.
What it never touches
Above every list sits a hard-coded denylist in Denylist.kt: the framework, System UI, Settings, the package installer, the permission controller, the TV provider (“it stores the TV’s channels and inputs”), Google Play services, the Play Store, TalkBack and the TTS voice, Bluetooth and the remote services, plus vendor setup wizards and vendor home screens. On top of that, SwitchOffRule.kt refuses anything the TV marks persistent, any TV input (HDMI, tuner, CEC, or a package that asks for TV_INPUT_HARDWARE), the current keyboard and screensaver, and any home screen app the person installed themselves.
The 150-second safety timer
The riskiest step is replacing the home screen: if the new launcher fails, the TV can end up with no working Home button. Before the switch, the app starts a detached shell on the TV (Watchdog.kt line 31):

The watchdog body from Watchdog.kt, unwrapped for reading.
If the phone confirms the new home screen, it writes the token file and kills the timer. If not, the TV re-enables its stock launcher on its own and starts HOME. The planner sets 150 seconds (DefaultPlanner.kt line 1076); the comment at line 61 explains it as the phone’s longest confirm window (120 seconds) plus 30 seconds for the steps in between. The template accepts 30 to 300 seconds and nothing else.
What this means for a TV app developer
1. Your channel rows live in the stock home. Preview channels and Watch Next are drawn by the TV’s own home screen. When a user lets CleanYourTV replace it, those rows are no longer on screen, even though the TV provider that stores them is protected. Do not make a channel row the only way into your content.
2. Your launcher entry is what remains. The replacement launcher’s source is not in this repository, but the probe finds apps through LEANBACK_LAUNCHER and LAUNCHER activities. Android’s TV app guide already requires a CATEGORY_LEANBACK_LAUNCHER activity and an android:banner of 320 x 180 px; without that filter the app “does not appear in the TV user interface”. Check both are present:
<application android:banner="@drawable/banner" ...>
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
</application>
3. Stay out of the ads and tracking groups. Lists group packages by what they do. A pre-installed streaming app gets a question; a separate ad, analytics or “partner install” package next to it gets switched off by default. If you ship a TV app through an OEM deal, keep its work inside the app package rather than in a background companion package.
4. Expect disable-user and recover cleanly. While a package is disabled, none of its components can run. If your app is switched off and later put back, treat channel sync and scheduled work as possibly gone and re-schedule them on the next launch instead of assuming they survived.
What to check on your own app
- Run
adb shell cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHERon a TV or emulator and confirm your activity is listed. - Search the lists for your package name:
grep -c your.package profile-meta.jsonin a clone of the repository. - Disable and re-enable your app with
pm disable-user --user 0andpm enable --user 0, then launch it and confirm channels and scheduled work come back.
The CleanYourTV lists are community-maintained and change with each release; the numbers above are for the v0.4.8 tag.



