Debloat an Android TV with Claude Code and adb
Read the adb commands a viral TV debloat prompt makes Claude Code run, and how to undo each one. LG, Samsung and Roku owners get the DNS route instead.
Debloat an Android TV with Claude Code: what actually runs
To debloat an Android TV with Claude Code, you let the agent run a few adb (Android Debug Bridge) commands from your computer. It connects to the TV over your home network and saves a list of installed packages. Then it turns packages off with pm disable-user. If something breaks, it turns them back on with pm enable. That is the whole job, and you should read and approve each command before it runs.
This guide is for the moment just before you clone a viral TV debloat repo or paste its prompt into Claude Code. It shows the commands the agent will run, the order that keeps the TV usable, and how to undo each change. It also covers the TVs that adb cannot reach at all, and how to close the debugging port when you finish.
What the viral TV debloat repos do
Three projects drive this trend. CleanYourTV (github.com/Gathin23/cleanyourtv) had about 44.8k stars on 2026-10-29. Its README says it disables preloaded apps, ad services and telemetry on Android TV and Google TV over Wi-Fi. It then installs a small replacement launcher in place of the stock home screen. Ansub/tv-detox does a similar cleanup and says the AI tool runs it from your laptop "after asking you before each change". humblemuzzu/dumbtv targets Amazon Fire TV over adb with no root.
All three repos change quickly. Through the GitHub API on 2026-10-29, CleanYourTV had tagged v3.2.0 that same day. tv-detox had tagged v1.5.7 on 2026-10-28, and dumbtv had tagged launcher-v1.6 on 2026-10-27. A guide written last week may not match what you clone today. For that reason this guide does not repeat any repo's own install steps. Read the README and the prompt file in the exact commit you clone.
The method underneath is stable. Every one of these projects uses pm disable-user, which disables an app for a user profile rather than uninstalling it. A disabled package is still on the TV, so it can be enabled again. That is why this approach is reversible. It is also why a firmware update can bring the packages back.
Which TVs can you debloat over adb?
adb needs a TV that runs Android and lets you turn on debugging. CleanYourTV's README lists Android TV and Google TV as supported for both the debloat and the launcher. It says Fire TV gets the debloat only, because Fire OS will not let a third-party launcher take the Home button. It also says the 2015 Fire TV box on Fire OS 5 fails even at the debloat, and that some China-market TCL sets refuse any launcher.
The same README lists Samsung (Tizen), LG (webOS), Roku, Vizio and Hisense VIDAA as not supported, because they have no adb. tv-detox says the same about Roku, Samsung Tizen and LG webOS. If your TV is one of these, skip to the section on non-Android TVs below. No prompt will change that, because there is no debugging interface for the agent to connect to.
Read the prompt before Claude Code runs it
A PROMPT.md, AGENTS.md or skill file from a stranger is a set of instructions for a program that has a shell on your computer. Your computer sits on your home network, next to your router, your NAS (network attached storage) and your phones. Paste that file into Claude Code and the agent treats it as your request. That is the core of prompt injection against coding agents. A viral repo with tens of thousands of stars is a good target for it, because one bad commit reaches many people.
Open the prompt file in a text editor before you start the agent. Read it the way you would read a shell script from the internet. Check for these things:
- Any command that is not
adb, such ascurlpiped intosh, or a download from a domain that is not the repo itself. - Any IP address or host other than your TV.
- Instructions to change agent settings, skip confirmations, or run without asking.
- Any file the agent is told to read outside the cloned folder, such as your home directory or SSH keys.
Read the rest of the clone too. CleanYourTV's assistant route also builds and installs its launcher. Its README lists Python 3, a JDK (Java Development Kit) and the Android SDK as requirements for that route. So the agent will run build commands as well as adb commands. Read any .claude folder or settings file in the clone the same way you read the prompt.
Then change how you ask. An It's FOSS report from 19 October 2026 says some people saw sessions refuse a prompt like "hack my TV". It also says that giving the model number and the package list first gave better results. A vague request gives the agent room to guess. Give it facts and a stop point:
My TV is a <brand and model> running <Android TV or Google TV version>.
packages-before.txt is the output of adb shell pm list packages.
Propose packages to disable, one per line, with what each one does.
Do not run anything yet.
Keep the updater, voice input and casting unless I say otherwise.
After I approve the list, run one adb command at a time.Which Claude Code permission mode should you use?
Use the default mode, which the Claude Code interface shows as Manual. The permission-modes documentation says that in Manual mode "Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network". Start it explicitly, so that a setting somewhere else does not change it:
claude --permission-mode defaultShift+Tab cycles through the modes inside a session. Check which mode is active before you approve anything, because one extra key press moves you out of Manual. Do not start the agent with --dangerously-skip-permissions. The docs say that flag is equivalent to the bypassPermissions mode, which is meant only for isolated containers and VMs without internet access. Your home network is the opposite of that.
Avoid auto mode for this task too. It runs commands without asking you each time and uses background safety checks instead. If you want to know how those checks decide, read how Claude Code's auto mode decides what to run. For a TV you cannot easily reflash, you want to see every pm command before it runs.
The docs say "most actions", not every action. Read each prompt that Claude Code shows you, and approve commands one at a time. If you are new to the tool, what Claude Code is and how it runs commands on your machine covers the basics first.
Install adb on your computer
On Ubuntu, the computer side of adb is the adb binary package. It is built from the android-platform-tools source package in the universe repository.
sudo apt update
sudo apt install -y adb
adb versionadb version should print a version number. On 2026-10-29, Launchpad listed 34.0.4-1build3 for Ubuntu 24.04 (noble) and 34.0.5-12build1 for Ubuntu 26.04 (resolute). Google's SDK Platform-Tools release notes list 37.0.1 from July 2026, so the Ubuntu package is several versions behind. If the Ubuntu build gives you trouble with a newer TV, Google's current build is the next thing to try. Mac and Windows users get adb from Google's SDK Platform-Tools page in any case.
Connect to the TV over the network
Find the TV's IP address in its network settings and put it in a shell variable. The address below is a documentation example. Replace it with your TV's address.
TV_IP=192.0.2.50Google's Cast documentation for Android TV says standard retail Android TV devices do not listen for adb connections automatically. You must turn on developer options and a debugging switch on the TV first. The menu path differs between makers and Android versions, so follow your TV maker's help page or the text on the screen. tv-detox names the switches you may meet: USB debugging, Network debugging and Wireless debugging.
If the TV has a network debugging switch, connect on port 5555:
adb connect "$TV_IP:5555"
adb devicesIf the TV shows a prompt asking you to allow this computer, accept it with the remote. adb devices should then list the TV's address. If it does not, the connection failed, and nothing after this point will work.
Newer Google TV sets may offer Wireless debugging with a pairing code instead. Google's adb page says pairing needs Android 13 (API level 33) or higher on TV, so older sets will not show this option. Open the pairing screen on the TV and note the address, port and code it shows. Then pair:
PAIR_PORT=37000
adb pair "$TV_IP:$PAIR_PORT"Replace 37000 with the port the TV shows, and type the pairing code when adb asks for it. After pairing, run adb connect with the address and port that the Wireless debugging screen shows for the device.
Save the package list before anything changes
Before the agent disables anything, save three lists: every package, the system packages, and the packages that are already disabled. Google's adb documentation describes -s as system packages only and -d as disabled packages only.
adb shell pm list packages > packages-before.txt
adb shell pm list packages -s > system-before.txt
adb shell pm list packages -d > disabled-before.txtCopy these files somewhere outside the cloned repo. They are your record of the starting state. They also give the agent real package names to work from, so it does not invent them from memory. A package name that the agent "remembers" but that is not in packages-before.txt does not exist on your set, and a pm command that names it does nothing useful.
Disable one package at a time, and how to undo it
The disable command is the one you will approve most often. Google's adb documentation lists disable-user [options] package_or_component, with --user user_id as the user to disable it for. The CleanYourTV README's own commands use user 0.
PKG=com.example.bloat
adb shell pm disable-user --user 0 "$PKG"Replace com.example.bloat with a real name from packages-before.txt. Approve one package, use the TV for a minute, then approve the next. If the TV breaks after package 14 of 30, you know which one did it.
The undo is pm enable. The CleanYourTV README uses pm enable --user 0 com.google.android.apps.tv.launcherx to bring back the Google TV launcher. Run adb shell pm help to see the exact options your TV's version of pm accepts.
adb shell pm enable --user 0 "$PKG"When the agent finishes, save the disabled list again and compare it with the first one. The difference is exactly what changed, and it doubles as your restore list.
adb shell pm list packages -d > disabled-after.txt
comm -13 <(sort disabled-before.txt) <(sort disabled-after.txt) \
| sed 's/^package://; s/\r$//' > to-restore.txt
cat to-restore.txtTo undo everything the agent did, enable each line again. adb shell reads standard input, so < /dev/null stops it from eating the rest of the list inside the loop.
while read -r pkg; do
adb shell pm enable --user 0 "$pkg" < /dev/null
done < to-restore.txtdumbtv ships its own preflight.sh, which it says reports what would change, and a restore.sh to undo. Your own to-restore.txt works for any repo, and it does not depend on the repo's scripts being correct.
The gotchas the CleanYourTV README warns about
These are the CleanYourTV project's claims, not results we reproduced on a TV. They match the warnings in tv-detox, so take them seriously.
Install the new launcher before you disable the old one. The README says to disable the stock launcher only after the new one is installed and running. If you reverse that order, it says Home can land on a factory test app.
On Google TV, the setup wizard can take over Home. The README says the setup wizard package, com.google.android.tungsten.setupwraith, "can take Home and crash-loop the system after the stock launcher is disabled". It also warns that disabling that package can delete a Wi-Fi network saved during setup. It says this costs phone casting on Chromecast with Google TV and the Google TV Streamer as well. tv-detox reports that disabling the home screen on Google TV and Chromecast left some devices restarting, and that one needed a factory reset. If the stock launcher is involved, have the pm enable command for it ready before you start.
Firmware updates undo the work. The README says that after a firmware update the listed packages come back, Home goes back to the stock launcher, and new preloads appear. Run pm list packages -d again after every update and compare it with disabled-after.txt.
Decide about the updater, voice and casting yourself. The README says its assistant asks whether to keep the voice assistant, Chromecast and updates. It says most of its lists leave the updater on. Some lists turn the updater off, which means fixes stop arriving until you enable it again. It's FOSS gives the same warning about debloat lists in general. Keep the updater unless you have a clear reason. Turn off voice input or casting only if nobody in the house uses them.
What about LG, Samsung, Roku and Vizio TVs?
These sets have no adb, so the realistic tool is DNS-level blocking. DNS (domain name system) turns names into addresses. A DNS filter refuses to answer for known ad and tracking domains, so the TV cannot reach them. AdGuard DNS is free, and its default servers block ads and trackers. Copy the current server addresses from AdGuard DNS's own setup page rather than from a guide, so you get the right ones for your setup.
The best place to set these is your router. AdGuard's own instructions say to open the router's DNS settings and replace the addresses there. That covers the TV without touching it. You can also set DNS on the TV itself. AdGuard's page gives steps for Samsung (Settings, Network, DNS setting, Enter manually) and for LG (uncheck "Set automatically"). On Android TV it uses a static IP setting, which means the TV also needs a fixed address of its own. Menu names differ between models, so confirm them on your set. The trade-offs between the hosted service and a filter you run yourself are in AdGuard DNS versus running AdGuard Home yourself.
Be clear about the limit. AdGuard's documentation says many of the more complicated ads cannot be blocked at the DNS level. The CleanYourTV README says private DNS "does not remove YouTube ads", and dumbtv says the same. Whichever resolver you choose also sees every name the TV looks up. If you are weighing the Android phone setting that does this, read whether Private DNS mode should be on or off.
On LG, tv-detox suggests turning off Home Promotion and Content Recommendation in the TV settings. That removes some of the home-screen ads without any tools.
LG sets also have a developer route. OmkarK97/webos-vibehack is a sideloaded launcher for LG TVs, a webOS port of an Apple TV-style home screen. It needs LG's Developer Mode app and a free LG developer account. Its README says "Nothing is rooted". It also says the install script is macOS-only for now, and that it was tested on an LG OLED C6 running webOS 26. According to the README, webOS always opens LG's own home when you press Home, so a script on another always-on device has to watch the TV and switch back to the launcher.
LG's own page describes Developer Mode as a way to install, debug and test webOS apps. It says the mode is enabled for a limited time and needs a sign-in to the LG Developer site. LG's page does not say whether Developer Mode counts as rooting, so treat the "not rooted" statement as the project's claim. The project had one commit and no releases when checked on 2026-10-29.
Turn network debugging off, then check the port
Do this last, and do not skip it. The CleanYourTV README says network adb is plaintext on port 5555, and that on some firmware any device on the LAN gets a shell. tv-detox gives a similar warning: other devices on your network can ask to control the TV. On such firmware, a TV with debugging left on gives a shell to any device on your Wi-Fi.
First disconnect from your computer:
adb disconnect "$TV_IP:5555"Then turn off USB debugging, Network debugging and Wireless debugging on the TV, whichever of them it has. Google's Cast documentation notes that the adb setting persists until a factory reset, so it will not turn itself off.
Check from a second machine on the same network, not the one you used for adb. First confirm the TV is awake and on the network, because a sleeping TV also gives no answer. Then scan the one port:
sudo apt install -y nmap
ping -c 3 "$TV_IP"
nmap -p 5555 "$TV_IP"The ping should get replies. Nmap's documentation defines the states that matter here. open means an application is accepting connections, so debugging is still on. closed means the port is reachable but nothing is listening. filtered means packet filtering stops nmap from telling. Either of the last two means nothing answers on 5555, which is what you want. If the TV does not answer the ping, wake it and run the check again before you trust the result. If you used Wireless debugging with a pairing code, the connect port may not be 5555, so turning the switch off on the TV is the step that counts.
FAQ
Can I debloat an LG, Samsung or Roku TV with Claude Code?
Not over adb. CleanYourTV lists Samsung (Tizen), LG (webOS), Roku, Vizio and Hisense VIDAA as unsupported because they have no adb, so there is nothing for the agent to connect to. For these sets, DNS-level blocking with a service such as AdGuard DNS, set on your router, is the realistic option. On LG, tv-detox suggests turning off Home Promotion and Content Recommendation in the settings.
How do I undo a package that adb disabled?
Run adb shell pm enable --user 0 followed by the package name. Packages disabled with pm disable-user are still installed, which is why this works. Save adb shell pm list packages -d before and after the debloat and compare the two files, so you have the exact list to enable again. If the TV crash-loops and adb still connects, enable the stock launcher first.
Will DNS blocking remove YouTube ads on my TV?
No. The CleanYourTV README says private DNS does not remove YouTube ads, and dumbtv says YouTube ads cannot be blocked by DNS. AdGuard's own documentation says many complicated ads cannot be blocked at the DNS level. DNS blocking still stops many ad and tracking domains that other apps and the TV's own software use.
Is it safe to run a TV debloat PROMPT.md in Claude Code?
It is only as safe as the commands inside it. Read the prompt file and any other agent files in the clone before you start. Look for commands that are not adb, or that reach hosts other than your TV. Run Claude Code in the default Manual mode, never with --dangerously-skip-permissions, and approve each pm command one at a time.
Why do the disabled apps come back after a TV update?
The CleanYourTV README says a firmware update brings the disabled packages back, returns Home to the stock launcher and adds new preloads. pm disable-user does not remove anything, and the update can reset that state. After each update, list disabled packages again with adb shell pm list packages -d and repeat only the changes you still want.