Connecting to your TV over Wi-Fi with ADB
· 3 min read
With debugging already on and the TV's IP written down, connecting takes two commands. What follows assumes ADB is installed on the computer; if not, start with installing ADB.
Prerequisite: the same network
The computer and the television have to be on the same local network. It sounds obvious, and it is the number one cause of failed connections: plenty of people have the laptop on 5 GHz Wi-Fi and the television on ethernet or the guest network, and those are often isolated from one another.
Connect
adb connect 192.168.1.45:5555
Substitute your television's address. If all is well, the reply is:
connected to 192.168.1.45:5555
The first time, look at the television screen. A dialogue will appear asking you to authorise debugging from that computer. Accept it and, if offered, tick "always allow from this computer".
Check you are in
adb devices
You should see something like:
List of devices attached
192.168.1.45:5555 device
The key word is device. If it says unauthorized, you did not accept the
dialogue on the TV screen. If it says offline, the connection was made but the
set is not answering: run adb disconnect and try again.
The three usual failures
"unable to connect", or it just hangs. Almost always a firewall, or network debugging having switched itself off. Many televisions turn it off on reboot: go back to Developer options and check.
The IP changed. The router hands out addresses by DHCP and your television's can change on restart. If it worked yesterday and not today, that is usually why. Worth reserving a fixed address in the router.
No authorisation dialogue. Happens when the television is inside a full-screen app. Go back to the home screen and reconnect.
Before touching anything: look
You are connected. The first thing is not to uninstall, it is to look:
adb shell pm list packages
You will get a long list of names like com.manufacturer.whatever. That is the
complete inventory of your television. Save it to a file, because it is your
safety net:
adb shell pm list packages > my-tv-before.txt
If you ever want to know what was there before you started, that file will tell you. It costs five seconds and saves grief.
Disconnect
When you are done:
adb disconnect
And to close it off properly, switch network debugging back off on the television. There is no reason to leave it on permanently.