Take the ads off your Android TV with Claude Code: the setup guide and the exact prompt
The short version
On 17 October Gathin T. gave Claude Code the model number of his parents' Xiaomi TV. It found the TV on the Wi-Fi, switched off 25 Xiaomi packages and wrote a new home screen that looks like an Apple TV. A few thousand people did the same to their own TVs over the next two days, and the prompt is now an open-source repo, CleanYourTV (MIT, 5,830 stars on 20 Oct).
No root, no cable, and nothing gets uninstalled: Android TVs have the same debug bridge (ADB) as Android phones, so it is standard Android tooling. With the repo as context it takes about fifteen minutes.
| Step | What you do | What Claude Code does |
|---|---|---|
| 1. Developer mode | Settings > Device Preferences > About > press OK on Build 7 times > Developer options > USB debugging on (and Network/ADB debugging if you see it) | Nothing yet |
| 2. The prompt | Paste the prompt below into Claude Code with your TV model, accept "Allow USB debugging?" on the TV | Finds the TV on your Wi-Fi, backs up every package and setting, then disables ad services, telemetry and content rows with pm disable-user |
| 3. The launcher | Answer the checklist: which apps you use, which four go in the dock | Builds a ~300 KB native launcher, installs it, makes it the home screen, checks each step with screenshots from the TV |
Works on Android TV and Google TV: 66 tested models from 25 brands (TCL, Xiaomi, Sony, Philips, Hisense, NVIDIA Shield and more). Not Samsung (Tizen) or LG (webOS). Fire TV gets the debloat half only.
Sources: TechCrunch, 19 Oct 2026 · github.com/Gathin23/cleanyourtv
Before you start (read this)
- One person bricked their Android TV doing this with Claude (TechCrunch). Agents can disable a package the TV needs. Disable in small batches and keep the restore script from step 2.
- The restore is one line:
TV_HOST=<tv ip> tools/restore.sh examples/<your tv>/debloat.txt(addcom.google.android.apps.tv.launcherxat the end on Google TV). - When you finish, switch USB debugging and Network/ADB debugging off again. Port 5555 is unencrypted on your network.
- Some boxes cut power to their USB port while debugging is on, so a USB speaker or drive goes quiet until you switch it off.
Copy these prompts
1. The exact prompt (from the repo's PROMPT.md)
Clone the repo first (git clone https://github.com/Gathin23/cleanyourtv) and open Claude Code inside it, so it reuses tools/ and launcher/ instead of writing them from scratch. Then paste this and fill in your model:
I want to debloat my Android TV and replace its launcher with a clean Apple TV style home screen.
My TV model is: <MODEL NAME HERE>. Work on the real device, step by step, and verify everything you
do with screenshots pulled from the TV. Ask me before anything that depends on my preferences.
Connect
- Find the TV on my network (hostname, ARP table, or ask me for the IP) and connect over ADB on port 5555.
If the TV is in another home, I'll give you its Tailscale address instead (docs/REMOTE.md): use that,
don't scan my local network.
- If the stock adb binary fails with "No route to host" on macOS even though the port is open, that is
macOS Local Network privacy blocking adb. Don't debug it: use the Python `adb-shell` package in a venv
as the ADB client instead. If its file push hangs on larger files, transfer files as base64 chunks
through the shell and verify the md5.
- If port 5555 stays closed, the TV may only offer Wireless debugging (Google TV sets often do): look for
`_adb-tls-connect._tcp` with `dns-sd -B` or `adb mdns services`, ask me for the code and port under
Developer options > Wireless debugging > Pair device with pairing code, then `adb pair`, `adb connect`
and `adb tcpip 5555`. Android switches Wireless debugging off whenever Wi-Fi drops.
- Tell me when the "Allow USB debugging?" prompt will appear on the TV so I can accept it.
- If `adb install` hangs on Android 14 it is waiting for an on-screen confirmation; push the APK and run
`pm install -r` over the shell instead.
Back up first
- Save the full package list, disabled-package list, getprop output and all settings to a backup folder
before changing anything, and write a restore script that re-enables everything you disable.
- Ask me what is plugged into the TV's USB ports. Some devices cut their power while USB debugging
is on, so warn me, and remind me to switch debugging off once you're done.
- When you finish, close network ADB instead of leaving it open: switch USB debugging and
Network/ADB debugging off on the TV, revoke the USB debugging authorisations, reboot, and check
that `nc -vz <tv ip> 5555` fails. Port 5555 is plaintext, and on firmware with `ro.adb.secure=0`
any device on the LAN can get a shell.
Debloat
- List installed packages and sort them into: manufacturer telemetry/analytics, manufacturer content
and ad services (PatchWall, recommendation rows, content providers), background services I probably
don't need (share/cast duplicates, cleaners), preloaded apps, and streaming apps.
- Disable the first categories with `pm disable-user --user 0`, never uninstall system packages.
- Never disable what the TV needs to work: the TV app and input services that play HDMI and the
tuner, the input/source menu, remote control and Bluetooth pairing services, the on-screen
keyboard, Google Play Store and Play Services. Manufacturer package names often don't say what a
package does: check its activities and services with `dumpsys package` first, and ask me if it's
still unclear.
- Before touching streaming apps, voice assistant, Chromecast, Miracast or the update service, ask me
which ones I use with a checklist question and disable only what I don't tick.
- Run `pm` commands one per shell call, chained commands may silently stop after the first.
- Disable in small batches and screenshot between them: a batch can take something load-bearing with
it and you cannot tell which.
- Offer me ad-blocking DNS as an optional extra: on Android 9 and newer, Private DNS set to an
ad-blocking resolver (`settings put global private_dns_specifier dns.adguard-dns.com`, then
`settings put global private_dns_mode hostname`). Tell me it doesn't block YouTube ads, check an app
still plays afterwards, and note the undo (`private_dns_mode opportunistic`) in the README.
Launcher
- Check that the TV accepts APKs before building anything. Some China-market sets answer every
sideload with `INSTALL_FAILED_VERIFICATION_FAILURE`, `adb install`, `pm install`, a hand-started
installer and even the manufacturer's own APKs all fail, and others refuse any package that
declares `android.intent.category.HOME` unless it carries the manufacturer's signature. If you
hit either, do the debloat half, say plainly that the launcher half is impossible here, and stop
retrying installs. The matching `examples/` header says which case your TV is.
- Don't install a third-party launcher that charges for basics like wallpapers. Build a small native
Android TV launcher instead (Java, AndroidX RecyclerView, minSdk matching the TV, debug build is fine),
install it over ADB, set it as the default home and disable the stock launcher. If several apps claim
the HOME intent, list them with `cmd package query-activities -a android.intent.action.MAIN -c
android.intent.category.HOME` and set the default with `cmd package set-home-activity`.
- Before disabling the stock launcher, check which other apps claim HOME: on Google TV the setup wizard
(`com.google.android.tungsten.setupwraith`) takes over even after the stock launcher is disabled, and
the matching `examples/` header says what to do. Before disabling setupwraith, run
`dumpsys wifi | grep -o 'cname=[^ ]*'`: a Wi-Fi network saved during first setup belongs to it, and
Android deletes that network the moment it is disabled, which takes the TV off Wi-Fi and ADB. If it
does, ask me to forget the network and re-join it in Settings first.
- On Android 11 and newer the launcher must declare `<queries>` for `android.intent.category.LEANBACK_LAUNCHER`,
or package visibility silently hides every app and the grid comes up empty; target a recent SDK, some
Google TV 14 sets refuse older targets at install.
- Design, Apple TV 4K style: pitch black background; a dock row at the bottom of the screen inside a
slightly lighter rounded band holding the four apps I pick (ask me which, and the order); the rest of
the apps in a 4-column grid below that scrolls up when I press Down; one translucent "glass" highlight
that springs from tile to tile instead of per-tile borders; the focused tile scales up slightly and
shows its name underneath; above the dock, the focused dock app's name in large light type with an
ambient glow in a colour sampled from its banner; frosted pill buttons top right for Inputs, Wi-Fi
(showing the network name) and Settings; a greeting, a large thin clock and the date top left in a
downloaded open-licence typeface such as Outfit. Inputs opens a compact glass dropdown under the pill
listing the HDMI ports, AV and Live TV, switching via the TV input framework.
- Make D-pad navigation deterministic: Up/Down move exactly one row, Up from the dock goes to the top
bar, the ends of the top bar don't fall through to tiles. Remember the last focused tile.
- Keep it light: the TV has about 1 GB of RAM. No blur, no video, no network polling.
Verify
- After each change, inject remote key presses over ADB, take a screenshot from the TV and look at it.
Fix what you see before moving on.
- Live TV and HDMI screenshots come back empty (0 bytes); that is the TV, not a broken debloat. Check
`dumpsys activity activities | grep topResumedActivity` instead (see `docs/TROUBLESHOOTING.md`).
- If a remote button relies on an accessibility helper, check that the service is enabled and bound
for the current user, then ask me to press the real button; an injected key is not proof (see
`docs/TROUBLESHOOTING.md`).
- When done, give me a restore script, a build-and-install script, and a README that explains how to
re-enable any app and how to change the dock order or the wallpaper.
Prompt: CleanYourTV PROMPT.md, MIT License, copyright (c) 2026 Gathin.
2. Check before it touches anything
Before you disable anything: list every package you plan to disable on my TV, grouped as telemetry, ad and content
services, background duplicates and preloaded apps. For each one say what it does and how you checked (dumpsys package).
Mark anything you are not sure about and ask me. Do not run any pm command until I say go.
If you are building with agents
This is the pattern worth stealing for any device you own: give the agent a real device on your network, make it back up first, make every change reversible (disable, never uninstall), and make it verify with screenshots after each step. Those three rules are why thousands of people could run the same prompt on 66 different TVs.
Run this on your own TV
- Turn on developer mode and USB debugging (step 1 in the table).
git clone https://github.com/Gathin23/cleanyourtv && cd cleanyourtv && claude- Paste prompt 2 first, read the list, then paste prompt 1 with your model.
- Keep the restore line handy. Switch debugging off when you are done.