Make an old Android TV fast again with Claude Code or Codex: a tiny ad-free home screen plus the prompt to clean it up
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Claude Code or Codex does the work. You just press OK on the remote.
As seen on
▶ Claude Made My Old Android TV Feel Brand New · the full setup on a real TV, in 4 minutes.
1. Turn on developer mode on the TV. Settings → Device Preferences → About → press Build 7 times. Then turn on USB debugging in Developer options. Stuck? Read the notes and warnings first.
2. Open Claude Code or Codex on your laptop. The laptop and TV must be on the same Wi-Fi.
3. Paste this in.
Help me clean up my Android TV and make it faster.
My TV is a <brand and model>.
1. Before you change anything, tell me in plain words:
this turns off system apps, and that has some risk.
A few TVs got stuck at the logo or kept restarting,
and you're an AI, so you can make mistakes. undo.sh
and your undo list turn everything back on. Ask me to
confirm I want to go ahead.
2. Connect to my TV over Wi-Fi. Walk me through anything
I need to tap on the TV.
3. Before changing anything, list every app in plain English:
safe to turn off, needed by the TV, and apps I use.
Check free memory.
4. Ask me before every change. Turn apps off instead of
deleting them. Keep a list of what you changed and how
to undo it.
5. Never turn off: Google Play services
(com.google.android.gms), Google Play, Settings,
System UI, setup apps, the keyboard, Bluetooth, my HDMI
inputs, the TV's input and tuner framework, or anything
else the TV needs to start. On Google TV or Chromecast,
also never turn off Google TV's home screen
(com.google.android.apps.tv.launcherx). If you're not
sure, leave it on.
6. Install the home screen: download
https://github.com/Ansub/tv-detox and run its
install.sh with my TV and these apps: <your apps>.
7. Turn off animations and make the TV sleep after 5
minutes. Then check the model name and ask me if the TV
is OLED. Keep the screensaver on unless I say it's not
OLED.
8. Wait 30 seconds after the last change, then restart the
TV once and check it starts up normally before you say
you're done. Show me free memory before
and after.
9. Once everything is checked, remind me to turn off USB,
Network and Wireless debugging (or Developer options)
on the TV. Left on, other devices on my network can ask
to control it. I only turn it back on for undo.sh or
updates.
That's it. It asks you before every change.
4. Turn debugging off when it's done. In Developer options, turn off USB debugging, plus Network debugging or Wireless debugging if you turned them on. Or turn off Developer options completely.
[!WARNING] Do it at your own risk. This turns off system apps. A few TVs got stuck at the logo or kept restarting, and the AI can make mistakes. It asks you before every change, and
undo.shplus its undo list turn everything back on. This is what worked for us, not professional advice. You're responsible for your own TV, and I'm not liable if something goes wrong.
[!WARNING] Google TV and Chromecast with Google TV: don't turn off the TV's own home screen. On some of these devices that left them stuck restarting, and the only fix was a factory reset. Since v1.4.1,
install.shleaves it on for Google TV unless you opt in withGOOGLE_TV=1. The cleanup still works and makes the TV faster. You just keep Google TV's own home screen.
[!WARNING] OLED TVs: keep the screensaver on. It stops a still picture from burning into the screen. Don't leave any home screen, this one included, on for hours.
[!NOTE] Turn debugging off afterwards. While USB, Network or Wireless debugging is on, other devices on your network can ask to control the TV. Turn it off once setup is done, and back on only to run
undo.shor update.
undo.sh or update.Chromecast with Google TV and other newer Google TVs usually only have Wireless debugging, which needs a pairing code. install.sh <TV_IP> alone won't connect. Instead:
adb pair <IP>:<pairing port> with the IP and port shown under the code, and type the code.adb connect <IP>:<port>.sh install.sh <IP>:<port>, sh undo.sh <IP>:<port>.The port changes every time the TV restarts, and the connection can drop. If a script says it can't reach the TV, pair and connect again. Don't restart the TV halfway through a cleanup.
Menus differ a bit by brand. If you're stuck, ask Claude or Codex: "I have a <brand and model> TV. How can you connect to it from my laptop and take control of it?"
Android TV 9 (a real TV), 11 and 12, and Google TV 14 (also a real TCL TV, see TCL notes). Every change is tested automatically on Android TV 9 and 11 emulators.
If your TV or streaming box runs Android TV or Google TV, it should work. That includes many Sony, TCL, Hisense, Philips and Xiaomi TVs, Chromecast with Google TV and Nvidia Shield. Some of those brands also sell Roku or other non-Android models, so check Settings > About if you're not sure.
The cleanup works, but leave Google TV's own home screen on, which means you keep Google TV's home screen. At least one Chromecast got stuck restarting after it was turned off, and it needed a factory reset. install.sh leaves it on by default since v1.4.1.
install.sh <TV_IP> won't reach a Chromecast.If the Accessibility screen freezes, this adb alternative adds our service while keeping TalkBack and any other enabled services (run from a Mac/Linux terminal):
adb shell '
service=com.ansub.tvhome/.HomeButton
services=$(settings get secure enabled_accessibility_services)
case "$services" in null|"") services="" ;; esac
case ":$services:" in
*":$service:"*|*":com.ansub.tvhome/com.ansub.tvhome.HomeButton:"*) ;;
*) services="${services:+$services:}$service" ;;
esac
settings put secure enabled_accessibility_services "$services"
settings put secure accessibility_enabled 1
'
To remove only our service with adb, leaving the others enabled:
adb shell '
services=$(settings get secure enabled_accessibility_services)
keep=""
IFS=:
for service in $services; do
case "$service" in
""|null|com.ansub.tvhome/.HomeButton|com.ansub.tvhome/com.ansub.tvhome.HomeButton) ;;
*) keep="${keep:+$keep:}$service" ;;
esac
done
if [ -n "$keep" ]; then
settings put secure enabled_accessibility_services "$keep"
else
settings delete secure enabled_accessibility_services
fi
'
On some Google TVs, once Google TV's home screen (com.google.android.apps.tv.launcherx) is off, Android picks the setup app (com.google.android.tungsten.setupwraith) for Home instead. install.sh spots this and asks before turning the setup app off too. It only asks if Home opens exactly that app, Google TV's home screen is already off and the TV has finished its first setup. Since v1.4.1 this only happens if you also opt in with GOOGLE_TV=1. YES=1 doesn't turn it off; use YES_SETUP=1 for that. This worked on a Sony BRAVIA and a TCL Smart TV Pro (Google TV 14), but it hasn't been tested on every TV. undo.sh turns it back on.
To undo it by hand:
adb shell pm enable com.google.android.tungsten.setupwraith
adb shell pm enable com.google.android.apps.tv.launcherx
If the TV ever asks to be set up again, or a setup screen won't finish, turn the setup app back on first.
On Philips Android TVs such as the 43PUS8535, Home may go through org.droidtv.homeintentresolver. Keep the router and remote/system services on. install.sh opens Settings, confirms it left the new home screen, then presses Home to test the router before keeping stock launchers off. If verification fails, it restores what it disabled. Restart once to check the new home screen opens at boot; otherwise run undo.sh over USB or port 5555.
Plain check.sh only reads state; check.sh <TV_IP> --fix may open Settings and press Home to test routing. If Home still opens the old screen, send the install output, firmware/Android version, and these results:
adb shell cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.HOME
adb shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME
adb shell input keyevent KEYCODE_HOME
adb shell dumpsys window | grep mCurrentFocus
Tested on a TCL Smart TV Pro (Google TV, Android 14, 2.3 GB of RAM). Every step below was followed by a restart, and the TV started normally each time. Free memory went from about 660 MB to about 1 GB, though part of that is just from restarting: the first number was taken after the TV had been on for 15 days.
Home screen. With Google TV's home screen off, Home opened the setup app's recovery screen, as in #16. Turning the setup app off too (YES_SETUP=1) made this home screen stick, through several restarts.
Connect on port 5555. If you connected with Wireless debugging (pairing code), turning the setup app off ends that connection halfway through install.sh. The script then says it couldn't turn the setup app off, even though it did. On this TV, the classic port also worked, so you can reconnect with adb connect <TV_IP>:5555, check with adb shell pm list packages -d, and run install.sh again with that address.
Safe to turn off, if you don't use them:
| App | Package |
|---|---|
| TCL account | com.tcl.usercenter |
| Built-in manual | com.tcl.ocean.instructions |
| TCL Channel (free channels with ads) | com.tcl.channelplus |
| TCL recommendations | com.tcl.waterfall.overseas |
| TCL notifications and promos | com.tcl.messagebox |
| Store demo | com.tcl.esticker, com.tcl.exhibit |
| Alexa built-in | com.tcl.smartalexa |
| Phone link | com.tcl.magiconnectfree |
| Repair guide, logs | com.tcl.repairguide, com.tcl.logkit |
| Screen mirroring | com.tcl.miracast |
| TCL analytics and Alexa hooks | com.tcl.ttvs |
| TCL interactive and ads service | com.tcl.interactive |
| Game bar for consoles | com.tcl.gamebar |
| Photo viewer, USB media player | com.tcl.gallery, com.tcl.ui_mediaCenter |
| App manager | com.tcl.guard |
| Bluetooth "listen alone" | com.tcl.t_solo |
| Google TV's screensaver (about 200 MB, keep it on an OLED TV) | com.google.android.apps.tv.dreamx |
Tiles that stay after the cleanup. Two TCL tiles can still show up on this home screen. TCL Channel is com.tcl.partnercustomizer, which also handles the TCL button on the remote. TCL Home is com.tcl.dashboard, TCL's quick settings panel. Both turned off without trouble.
Keep these on:
com.tcl.tvinput: the HDMI inputs and the tuner.com.tcl.tv: Live TV, which is also the screen that shows HDMI. Turning it off breaks every HDMI input, even if you never watch antenna or cable TV.com.tcl.suspension: the input picker.com.tcl.inputmethod.international: the TCL keyboard.com.tcl.providers.config: other TCL apps read their settings from it.com.tcl.useragreement: TCL's privacy switches.HDMI stopped working? If the TV sees the device but won't switch to it, com.tcl.tv is probably off. com.tcl.tvinput only provides the signal; com.tcl.tv's player is the only screen that shows it. Bring it back with adb shell cmd package install-existing com.tcl.tv (or adb shell pm enable com.tcl.tv if it was turned off rather than removed).
Optional: the phone keyboard keeps popping up. On this TV, Google TV's phone-remote service made its phone keyboard the TV's keyboard again after every restart. If that happens to you, first note which keyboard you have now:
adb shell settings get secure default_input_method
Then switch to the TCL keyboard and turn the phone-remote service off:
adb shell ime set com.tcl.inputmethod.international/.T_IME
adb shell pm disable-user --user 0 com.google.android.tv.remote.service
This also stops your phone from working as a remote: no typing, voice search or control from the Google TV or Google Home app. undo.sh doesn't undo it. To undo it by hand, turn the service back on and switch back to the keyboard you noted:
adb shell pm enable com.google.android.tv.remote.service
adb shell ime set <the keyboard you noted>
The TCL logo at startup is part of the TV's firmware, so it can't be turned off. On this TV, turning it off with the remote (not at the wall) let TCL's quick start wake it straight to the home screen, with no logo.
TCL Q651G (Google TV, Android 12). Also tested on two TCL Q651G TVs (43" and 50", 1.8 GB of RAM) with GOOGLE_TV=1 YES_SETUP=1 on port 5555. Both started normally after every restart, and free memory went from about 560 MB to about 840 MB. A few notes for these TVs:
Keep com.tcl.tv on, same as above. It's the only app that shows HDMI on these TVs too.
Wi-Fi was forgotten. On both TVs, the TV forgot its Wi-Fi network partway through install.sh, which also ended the adb connection. The likely cause: Android erases the networks an app saved when that app is turned off, and Google TV's setup app had saved it (see rule 5). install.sh now checks this and leaves the setup app on. To get past it, forget the network on the TV, join it again, and run install.sh again. If your TV has an Ethernet port, a cable avoids this.
Optional: Usage & diagnostics (Settings > Privacy) is part of the setup app, so it won't open once that app is off. Only on these TVs, after install.sh turned the setup app off: connect on port 5555 (not Wireless debugging), then turn the setup app on for a moment. While it's on, don't press Home, because Home opens the setup app.
adb shell pm enable com.google.android.tungsten.setupwraith
adb shell am start -a com.google.android.settings.USAGE_AND_DIAGNOSTICS_SETTING
# switch it off on the TV, press Back, then:
adb shell pm disable-user --user 0 com.google.android.tungsten.setupwraith
adb shell cmd role add-role-holder --user 0 android.app.role.HOME com.ansub.tvhome
adb shell cmd package set-home-activity com.ansub.tvhome/.MainActivity
The app buttons on the remote (YouTube, Netflix and others) stopped working, even for apps that are still installed. TCL sends these buttons through one of its own apps first. We haven't confirmed which one. If you need them, try turning com.tcl.partnercustomizer back on, then com.tcl.ttvs, with adb shell pm enable <package>.
No TCL keyboard. com.tcl.inputmethod.international isn't on these TVs, so Gboard is the only keyboard: keep it on. Skip the optional keyboard step above, or set Gboard instead (find its name with adb shell ime list -s).
Also turned off without trouble: TCL TV+ (com.tcl.tv.plus, free channels with ads), Samba TV (tv.samba.ssm.ui, which recognises what's on screen for ads), com.tcl.tv.tclhome_passive, com.tcl.smartlink.core and com.tcl.hotelmenu. AirPlay (com.tcl.airplay2, ) can be turned off too if you don't use it.
TCL 32S4K (Google TV, Android 14, MediaTek MT5867, 954 MB of RAM). Tested with GOOGLE_TV=1 YES_SETUP=1 on port 5555, with a restart after every batch. It started normally each time. Measured 4 minutes after a restart, compressed swap in use went from 216 MB to 132 MB and free memory from 380 MB to 419 MB, and the home screen went from 84 MB to 25 MB. Storage went from 1.41 GB to 1.95 GB free. The swap is what you feel on a TV this small: its storage writes at under 10 MB/s.
com.tcl.tv or com.tcl.tvinput. HDMI goes through com.mediatek.wwtv.tvcenter and com.mediatek.tvinput, and the remote's keys through com.mediatek.tv.service (check with adb shell dumpsys window policy). Keep all three on.cname=com.google.android.tungsten.setupwraith. We forgot the network on the TV and joined it again before install.sh, and Wi-Fi then survived the setup app going off.com.tcl.ttvs, about 26 MB), com.tcl.partnercustomizer, com.tcl.keyhelp, com.tcl.messagebox, com.tcl.logkit, com.tcl.browser, two store demos (fusion.android.tv.demo, com.mediatek.MtkDemo) and Google's partner app installer (android.autoinstalls.config.google.gtvpai). Every remote button still worked, because on this TV they don't go through TCL's apps.com.google.android.katniss, about 54 MB), casting, the phone remote and Google TV's screensaver. Each one is worth it on 1 GB of RAM if you can do without the feature.pm art dump <package>), so neither helps here.Tested on a OnePlus TV E00 (QLED, Android TV 11 with Google TV's home screen, 2.9 GB of RAM). The cleanup was followed by a restart, and the TV started normally and opened this home screen by itself. Free memory went from about 1.34 GB to about 1.67 GB, though part of that is just from restarting.
Home screen. OnePlus ships two home screens: OxygenPlay (com.oneplus.tv.launcher) and Google TV's (com.google.android.apps.tv.launcherx). Turning off Google TV's is up to you and at your own risk: it worked on this TV, but it has left some Google TVs (like Chromecast) stuck restarting. Only try it if you can reconnect over USB or port 5555. If you leave it on, the cleanup still works and Home keeps opening Google TV's home screen. If you do turn it off and Home opens Google TV's setup app, run install.sh again with GOOGLE_TV=1 YES_SETUP=1, the same fix as on the TCL above.
Safe to turn off, if you don't use them:
| App | Package |
|---|---|
| OxygenPlay home screen | com.oneplus.tv.launcher |
| OnePlus message board and promos | com.heytap.tv.msgboard |
| Store demo | fusion.android.tv.demo |
| User guide | com.oneplus.tv.userguide |
| Weather | net.oneplus.weather |
| ColorOS Relax | com.coloros.relax.tv |
| Screen mirroring (Miracast) | com.heytap.optvmiracastservice |
| OnePlus phone link | com.heytap.olink, com.heytap.ars.sink |
| Bluetooth speaker mode | com.heytap.tv.btspeaker |
| Camera | com.heytap.tv.camera |
| AirScreen | com.ionitech.airscreen |
Keep these on:
com.heytap.tv.livetv: Live TV, which also opens the HDMI input list. Turning it off can stop you switching inputs.com.mediatek.*, com.oneplus.tv.factory, com.oneplus.tv.remote: the remote's buttons, the input key, the tuner and HDMI.Remote buttons. If you turned Google TV's home screen off, the Guide and All apps keys do nothing, because they open it. That's expected.
The chat in the Claude app (and claude.ai) runs on Anthropic's servers, not on your laptop, so it can't see your TV. You need something that runs on your own laptop: Claude Code or Codex.
Don't want to pay for either? Skip the AI and use install.sh instead (see "Can I install the home screen without AI?" below).
Not yet. Claude has to run on a computer on the same network as your TV. A phone hotspot is fine as that network, as long as the laptop and TV both join it.
That works the same. Your laptop talks to the TV over its IP address on your home network, so cable or Wi-Fi doesn't matter. The laptop just has to be on the same network. You'll find the TV's IP in its network settings, or ask Claude to find it.
Yes. Leave out step 6 of the prompt ("Install the home screen"). Your TV looks the same, just with the junk turned off.
First, optionally, check the TV itself:
sh supports.sh <TV_IP>
It prints what the TV is (make, model, Android version, RAM), which home screens can take over, how many apps are already turned off, and whether swapping the home screen is a good idea on that set. It changes nothing.
Then run the planner. It reads the TV and prints every app with a verdict, changing nothing:
sh candidates.sh <TV_IP>
never the TV needs it, keep it carries a feature you may use, safe common junk, review unknown. docs/debloat.md explains the rules behind the verdicts, the traps — apps Android restarts whatever you do, the app that carries casting, and package names that hide what the app really is — and the never-touch and commonly-safe lists.
You can. The cleanup is the part that makes the TV faster, and it works with any home screen. This one is here if you want something tiny and open source: one screen, no ads, no account, about 30 MB of RAM.
That's a TV setting, not this home screen. Ask it: "My TV opens Live TV at startup instead of the home screen. Find that setting and turn it off."
Some remote buttons are handled by the TV's own home screen or by apps the cleanup turned off. To see which app handles which button, ask Claude: "Run adb shell dumpsys window policy and tell me which apps my remote's global keys go to." If it's an app other than your TV's home screen, turn that app back on.
The YouTube button on some Google TVs (seen on Xiaomi and Vu): it goes to Google TV's own home screen, which install.sh turns off, so the button does nothing. Turning that home screen back on brings the button back, but your TV may then open Google TV's home screen again instead of this one. Until there's a safe fix, open YouTube from its tile on the home screen.
sh check.sh <TV_IP> # check the home screen is still in charge
sh check.sh <TV_IP> --fix # and fix it
sh check.sh <TV_IP> --fix my-tv.txt # also check your own list of changes
Your list has one change per line, like off com.example.app, global window_animation_scale 0 or device_config activity_manager max_cached_processes 4. Ask Claude to write it from the changes it made.
Yes. You only need adb. On a Mac, run brew install android-platform-tools. On Windows, download Google's SDK Platform Tools, unzip it, and run the commands below from Git Bash. Download this repo, then:
sh install.sh <TV_IP> # picks your TV apps for you
sh install.sh <TV_IP> "com.netflix.ninja,com.hulu.livingroomplus" # or choose them
sh install.sh <TV_IP> "" "bluetooth,sound,picture" # add settings shortcuts
Most TVs keep opening their own home screen, so the script offers to turn that off. Nothing is uninstalled.
The cleanup half is a judgement call per app, so it's not automated. sh candidates.sh <TV_IP> lists every app with a verdict and docs/debloat.md gives the rules, if you'd rather decide yourself than have the AI do it.
Use the remote. Hold OK on an app (or press Menu) to:
To add an app, pick the Add app tile in the bottom row. Add as many apps as you like: they wrap into rows of six, and the page scrolls once there are more than twelve. Your changes are kept until you run install.sh with a new app list.
HDMI tiles work the same way. Hold OK on one to Rename it — TV, PlayStation, Xbox, Switch, Laptop, PC, Blu-ray, Soundbar — or choose Type a name… to enter your own with the TV’s keyboard. You can also Remove it from the home screen. A removed input comes back by holding OK on the Add app tile. This only changes this home screen; the TV's own input names stay as they are.
Yes. Pick the Settings tile, then Wallpaper. (TV settings, right under it, opens the TV's own settings.) There are fourteen gradients. Dark: Dusk (the default), Midnight, Plum, Forest, Graphite, Ocean and Ember. Bright: Sunset, Lagoon, Aurora, Coral, Iris, Meadow and Gold. The background changes as you move through the list; press OK to keep one, or Back to leave it as it was. They're colours only, no pictures, so every one is just as fast and uses the same memory.
Yes. A small network icon always sits next to the clock. It shows Wi-Fi (with signal bars), Ethernet or a crossed-out Wi-Fi when you're offline, and opens your network settings. Bluetooth, Sound and Picture shortcuts can join it. They're off unless you ask for them:
sh install.sh <TV_IP> "" "bluetooth,sound,picture" # pick any of them, in any order
sh install.sh <TV_IP> "" "none" # take them away
Press Up from your apps to reach them. A shortcut your TV has no screen for is left out. On TCL TVs, Sound and Picture open TCL's own panels.
sh undo.sh <TV_IP>
This turns your TV's own home screen back on and removes this one. To undo the cleanup too, ask Claude or Codex to reverse everything on its list.
If you turned debugging off after setup, turn it back on first, then off again when you're done.
Your laptop can often still connect for a few seconds each time the TV starts. Use that to turn everything back on:
adb connect <TV_IP>
adb wait-for-device
adb shell pm list packages -d
That lists everything that's turned off. Turn each one back on with adb shell pm enable <package>, or all of them at once:
for p in $(adb shell pm list packages -d | tr -d '\r' | sed 's/package://'); do adb shell pm enable "$p"; done
To undo just the home screen, run sh undo.sh <TV_IP>. Then restart the TV. You can redo the cleanup later, one app at a time.
If the laptop never connects, use the TV's recovery mode or a factory reset. How you get there depends on the brand and model, so check your TV maker's support page.
apps.txt (package names, one per line). You can also pass them to install.sh instead.brew install openjdk@17
brew install --cask android-commandlinetools
sdkmanager "platforms;android-34" "build-tools;34.0.0"
sh build.sh, then sh install.sh <TV_IP> installs your build instead of the release.sh ci/smoke-test.sh <TV_IP or emulator> checks it all works.CLOCK=24 sh install.sh <TV_IP> sets a 24-hour clock (or CLOCK=12 for a 12-hour one, CLOCK=auto to follow the TV again). On the TV, holding OK on an HDMI tile renames or removes that input.FAKE_INPUT=1 sh install.sh <emulator>. That builds and installs ci/fake-input (a TV input service with no hardware behind it) and tells the home screen to show it. undo.sh removes it again. It is for emulators only.HDMI inputs are found on their own. The labels follow the TV's language, with 16 languages built in. To add yours or fix a translation, edit src/com/ansub/tvhome/Strings.java. Keep key.jks, which is made on your first build: updates must be signed with the same key.
It's one screen of plain Java, no libraries, no Gradle. The background is drawn once, the only animation is the focus lift, and it uses about 30 MB of RAM.
Pull requests are welcome for fixes that keep working on every TV. This project sticks to official apps and Android's own settings, so changes that add ad blockers or unofficial apps won't be merged. If you want those, fork it and make it yours.
Made by Ansub Khan. I build things like this with AI every week.
MIT License
com.realtek.airplay2