Put shangOS on your TV
Turn on debugging, run one command on your computer, follow the wizard. About five minutes, and you can undo all of it.
Before you start
You need an Android TV or Google TV on Android 12 or newer, a computer on the same Wi-Fi or network cable, and the TV remote. It takes about five minutes. It needs no root and replaces no firmware.
What changes on your TV
One app is installed, and it is set as the home screen. The TV’s own home and setup apps are left switched on (on some Google TVs the TV cannot start without them). If you choose them, three optional permissions are granted (Up Next, Now Playing, recent apps) and the shangOS screen saver is selected. Nothing else is touched. HDMI, Chromecast, picture settings and Bluetooth remotes keep working.
Not for phones and tablets. Not tested on Fire TV.
1. Turn on debugging on the TV
Become a developer
Find the build entry for your TV in the table below, and press OK on it seven times until a message says You are now a developer.
Menu names change between firmware versions. If yours differ, search Settings for “Build” and “Developer options”. Your device Turn on Developer options Then open Google TV Streamer, Chromecast with Google TV, onn., TCL, Hisense, Sony BRAVIA (Google TV) Settings, System, About, press Android TV OS build 7 times Settings, System, Developer options Sony BRAVIA (older Android TV), Philips, Sharp Settings, Device Preferences, About, press Build 7 times Settings, Device Preferences, Developer options Xiaomi Mi Box S, Mi TV Stick, Xiaomi TV Settings, Device Preferences, About, press Build 7 times Settings, Device Preferences, Developer options NVIDIA Shield TV Settings, Device Preferences, About, press Build 7 times Settings, Device Preferences, Developer options Switch debugging on
In Developer options, turn on USB debugging. Some TVs call it Network debugging. On Android 11 and newer you may see Wireless debugging instead; see pairing below.
Allow your computer
The first time the computer connects, the TV asks Allow USB debugging?. Choose Always allow from this computer and press OK. Look at the TV screen, not the computer.
Find the TV’s address (optional)
The wizard usually finds the TV by itself. If it cannot, note the IP address under Settings, Network & Internet, then your connection (for example
192.168.1.50).
2. Run the setup wizard
Open a terminal (macOS, Linux) or PowerShell (Windows), and run the line for your computer. No administrator rights are needed.
macOS
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bashLinux
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bashWindows
PS> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1'))The wizard is five short steps. Move with the arrow keys (or j/k), choose with Enter, switch options with Space, go back with Esc, quit with q.
TV
Lists TVs adb already knows, TVs announcing Wireless debugging on your network, and addresses you saved. Or type an address, or pair with a code. It checks the TV runs Android 12 or newer.
Build
Standard, or Offline which has no internet permission at all (no weather, no remote posters).
Options
Optional permissions, making it the home screen, a faster compile, the screen saver, and ad and tracker blocking (off unless you tick it).
Review
Shows the exact commands, then asks once.
Install
Downloads the release from GitHub, checks its SHA-256 against the published
SHA256SUMS, installs it, and applies your options. Every command that changes the TV is printed first, on a line starting with+.
Without a menu
For scripts and unattended installs, pass options. --yes (-Yes on Windows) takes every default and asks nothing.
macOS
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --tv 192.168.1.50:5555 --variant offline --yesLinux
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --tv 192.168.1.50:5555 --variant offline --yesWindows
PS> & ([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1'))) -Tv 192.168.1.50:5555 -Variant offline -Yes| Option | Windows | What it does |
|---|---|---|
--tv ADDRESS | -Tv | The TV’s address, with or without :5555. |
--variant release|offline | -Variant | Standard (default) or Offline. |
--release v0.4.0 | -Release | A specific release instead of the latest. |
--apk FILE | -Apk | Install an APK you already have. |
--no-home, --no-widgets, --no-aot | -NoHome, -NoWidgets, -NoAot | Skip one step. |
--saver | -Saver | Also use the shangOS screen saver. |
--block-ads | -BlockAds | Also turn on ad and tracker blocking for the whole TV (read the limits). |
--dns adguard|HOSTNAME|off | -Dns | Only change the TV’s Private DNS; no install. |
--status | -Status | Show what is installed and what Home opens. |
--uninstall | -Uninstall | Undo everything. |
--pair HOST:PORT --code 123456 | -Pair, -Code | Pair with a TV that shows a code. |
--plain, --no-color | -Plain, -NoColor | No menus, or no colours. |
Read it before you run it
It is a plain text script. The wizard only talks to GitHub (to download the release) and to your TV; the one exception is your own package manager, if you let it install adb.
macOS
$ curl -fsSL -o setup.sh https://shangos.madusha.dev/setup.sh
$ less setup.sh
$ bash setup.shLinux
$ curl -fsSL -o setup.sh https://shangos.madusha.dev/setup.sh
$ less setup.sh
$ bash setup.shWindows
PS> (New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1') | Set-Content setup.ps1
PS> notepad setup.ps1
PS> powershell -ExecutionPolicy Bypass -File .\setup.ps1No adb on your computer? The wizard offers to install it with your package manager (Homebrew, apt, dnf, pacman, zypper, or on Windows winget, Scoop or Chocolatey) and shows the command first. Or get platform-tools from Google.
Optional: block ads and trackers on the whole TV
shangOS itself shows no ads, but your other apps can. This optional step sets the TV’s Private DNS (an Android setting since Android 9) to a server that refuses known ad and tracker domains. It applies to every app that uses the TV’s normal DNS, and it does not touch shangOS.
macOS
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --dns adguard$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --dns offLinux
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --dns adguard$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --dns offWindows
PS> & ([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1'))) -Dns adguardPS> & ([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1'))) -Dns offOr tick Block ads and trackers in the wizard’s options, or pass --block-ads (-BlockAds) when installing. Choose Use my own DNS hostname in the wizard’s menu for a NextDNS profile, your own AdGuard Home or a Pi-hole that speaks DNS-over-TLS. The wizard checks that the TV can still look up names afterwards, and puts the old setting back if it cannot.
By hand
$ adb shell settings put global private_dns_specifier dns.adguard-dns.com
$ adb shell settings put global private_dns_mode hostname$ adb shell settings put global private_dns_mode opportunisticWhat to know first
| Topic | Details |
|---|---|
| Who sees what | The DNS provider sees the names your TV looks up (for example example.com), though not the pages. Pick one you trust and read its privacy policy. The default here is AdGuard DNS (dns.adguard-dns.com), which blocks ads, trackers and known malicious domains. |
| It is system-wide | Free streaming apps may show fewer ads, load slowly, or refuse to start when their ad servers do not answer. If that happens, turn it off. |
| Apps can skip it | Apps that bring their own DNS, or a fixed one, ignore the TV’s setting. Nothing on the TV can stop that without root. |
| Needs | Android 9 or newer. The wizard checks that names still resolve after the change and undoes it if not; if the TV was offline when you set it, it cannot check. |
| Undo | --dns off (-Dns off) puts back whatever the TV had before, or Automatic. Removing shangOS leaves it as it is, and offers to undo it. |
For apps that skip the filter (advanced)
The place to catch them is your router, not the TV. Run a filter on your own network (Pi-hole or AdGuard Home), send all DNS requests on port 53 to it, and block outgoing port 853 (DNS-over-TLS) so apps cannot use another server. DNS-over-HTTPS looks like ordinary web traffic, so it can only be stopped with a domain list of known servers. Do one or the other: blocking port 853 also blocks the Private DNS setting above, unless its server is on your own network.
TVs that show a pairing code
Newer Google TV builds can use Wireless debugging, which asks for a one-time pairing first.
Open the pairing box
Developer options, Wireless debugging, Pair device with pairing code. The TV shows an address with a port, and a six-digit code. Keep that box open.
Pair
In the wizard choose Pair with a code, or run it yourself:
macOS
$ adb pair 192.168.1.50:37123Linux
$ adb pair 192.168.1.50:37123Windows
PS> adb pair 192.168.1.50:37123Type the six-digit code when asked.
Connect
Close the box. The main Wireless debugging screen shows a different port. Use that one:
adb connect 192.168.1.50:41234, or pick the TV in the wizard (it appears under “Found on your network”).
Do it by hand with adb
The wizard runs exactly these. Replace the address and the file name with yours.
# 1. connect, and accept the prompt on the TV
$ adb connect 192.168.1.50:5555
# 2. install the signed release
$ adb install -r shangos-v0.4.0-release.apk
# 3. make it the home screen
$ adb shell cmd package set-home-activity --user 0 dev.madusha.shangos/.MainActivityPress Home on the remote. If the TV still opens its own launcher, that is normal on some Google TVs. Open shangOS from the app row, or choose “Always” if the TV asks which home to use. Do not switch the TV’s own home or setup app off unless you have read the warning below: on some Google TVs the TV then cannot start.
Optional permissions for Up Next, Now Playing and recent apps:
$ adb shell pm grant dev.madusha.shangos android.permission.READ_TV_LISTINGS
$ adb shell cmd notification allow_listener dev.madusha.shangos/dev.madusha.shangos.MediaListener
$ adb shell appops set dev.madusha.shangos GET_USAGE_STATS allowUndo everything
Run the wizard and choose Remove shangOS, or pass the uninstall option:
macOS
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --uninstallLinux
$ curl -fsSL https://shangos.madusha.dev/setup.sh | bash -s -- --uninstallWindows
PS> & ([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://shangos.madusha.dev/setup.ps1'))) -UninstallBy hand, switch your TV’s launcher back on before removing shangOS, so the TV always has a home screen:
$ adb shell pm enable --user 0 com.google.android.tvlauncher
# or com.google.android.apps.tv.launcherx on newer Google TV builds
$ adb uninstall dev.madusha.shangosOrder matters
Removing shangOS while the TV’s own launcher is still switched off can leave the TV with no home screen. If that happens, run adb shell pm enable --user 0 com.google.android.tvlauncher from your computer.
If your TV loops after a restart
Some Google TVs cannot start without their own home or setup app
Older versions of this wizard switched those off to make shangOS the home screen. On some Google TVs (a Sony Bravia, for one) that leaves the TV unable to start: a blank screen, a restart, and round again. Since 0.6 the wizard never switches the setup app off, leaves the TV’s own home on unless you pass --disable-stock, and switches anything an older version turned off back on.
If your TV is looping now:
Switch the TV off at the wall
Leave it off for 10 to 15 minutes, then switch it on again. Have your computer ready.
Switch them back on as soon as the TV answers
Each loop gives a short window. Keep trying until the commands go through:
$ adb connect 192.168.1.50:5555 $ adb shell pm enable com.google.android.apps.tv.launcherx $ adb shell pm enable com.google.android.tungsten.setupwraith $ adb shell pm enable com.google.android.tvlauncherSome of these are not on your TV; the error for those is harmless.
Then run the wizard again
The current version leaves them on. If you set shangOS up with an older version and the TV is not looping, run the wizard once before the next restart: it switches them back on by itself.
If shangOS itself crashes twice within five minutes, it stands aside and lets the TV’s own home open, and tries again a few minutes later, so a broken build cannot hold the TV in a loop either.
Verify a download
If you download the APK yourself, check it before installing. Put the APK and SHA256SUMS from the same release in one folder.
macOS
$ shasum -a 256 -c SHA256SUMS --ignore-missing
$ apksigner verify --print-certs shangos-v0.4.0-release.apkLinux
$ sha256sum -c SHA256SUMS --ignore-missing
$ apksigner verify --print-certs shangos-v0.4.0-release.apkWindows
PS> (Get-FileHash .\shangos-v0.4.0-release.apk -Algorithm SHA256).Hash
# compare with the line in SHA256SUMS
PS> apksigner verify --print-certs shangos-v0.4.0-release.apkapksigner is part of Android’s build-tools. The certificate SHA-256 it prints must match the release notes on GitHub, and the one shown on the TV under Settings, Privacy, This build.
If something goes wrong
| What you see | What to do |
|---|---|
failed to connect, or the TV is not listed | The TV and computer must be on the same network, and debugging must be on. Wake the TV first. Try the address with :5555. On newer builds use Wireless debugging and pair. |
unauthorized | Look at the TV. An Allow USB debugging? box is waiting: choose Always allow from this computer, then OK. |
| Home still opens the old launcher | Some TVs insist on their own. shangOS leaves it on, because on some Google TVs the TV cannot start without it. Open shangOS from the app row. At your own risk, --disable-stock (-DisableStock on Windows) switches the launcher off after asking; read the warning first. |
INSTALL_FAILED_UPDATE_INCOMPATIBLE | The TV has shangOS signed with another key, for example a build you made yourself. Android will not update it in place. The wizard offers to remove the old one first; that clears shangOS’s own settings only. |
INSTALL_FAILED_VERSION_DOWNGRADE | The TV has a newer version than the one you are installing. The wizard offers to downgrade. |
| No TV found by the wizard | Some routers block the announcements that discovery uses. Give the address yourself: --tv 192.168.1.50:5555. |
| GitHub is rate-limiting | Wait a few minutes, or download the APK from the release page and pass it with --apk. |
| Windows: “running scripts is disabled” | That applies to saved files only. The one-line command is not affected. For a saved copy, use powershell -ExecutionPolicy Bypass -File .\setup.ps1. |
| Apps stopped loading after I turned on ad blocking | Turn it off with --dns off (-Dns off). Some apps depend on the ad servers answering. |
| Colours or boxes look broken | Use a modern terminal (Terminal, iTerm2, GNOME Terminal, Windows Terminal), or add --plain (-Plain) for plain text. |