debugging for Android TV
charles proxy
For Android TV, we are able to debug only debug builds using Charles Proxy. We also need an SSL certificate specifically for the Android TV apps that we are testing.
First, we need to install Charles Proxy on our computer (https://www.charlesproxy.com/download/). Then we have to do a few more things to complete set up:
Install the SSL certificate that we downloaded for the Android TV on our machine.
Enable SSL Proxying (enter * as the host).
Enable Transparent HTTP Proxying (enter 8888 as the port).
Enter * in the host field for Recording Settings to make sure all traffic is being recorded.
manual proxy on the Android tv
We now have to enable the manual proxy on the Android TV itself to send traffic to Charles on our PC:
Go to Settings.
Select Network.
Select the Network your PC is connected to.
Select Proxy settings.
Select Manual.
Enter the IP address of your PC (Charles -> help -> local IP address) in the Proxy hostname and click Next.
Enter 888 in the Proxy port and click Next.
You might have to leave the “Bypass proxy for” empty or enter something in there in case certain app functionalities are blocked by this (ex. “localhost” to unblock live playback). Click Next.
Android TV app traffic
Now we can launch Charles and then the app we want to test and debug. We should immediately see traffic appearing for the app (config, screens, video player calls, etc). If we drill down through the calls we’re interested in we can view the info for the requests and responses. We can also view this info in Charles in two different ways:
Sequence display where you can view the requests in the order that they occur.
Structure display which shows requests sorted by the host name which can be expanded to show folders.
Remember to reopen the Network Settings on your Android TV and disable the proxy when you’re done and replace the Android TV SSL certificate with the one for your PC.