debugging for tvos
charles proxy & Apple Configurator
For tvOS, we are able to debug all app environments from QA test builds to in-market apps using Charles Proxy. However, we need a Mac to be able to do this.
First, we need to install Charles Proxy on our computer (https://www.charlesproxy.com/download/) as well as Apple Configurator (from the Apple store). Then we have to do a few more things to complete set up:
Install the SSL certificate 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.
Physically connect the tvOS to the Mac (USB-C from the back of the tvOS to the USB on the Mac).
Launch Apple Configurator and double click on the tvOS device.
Click on Prepare and leave the fields as they are while continuing to click Next (can enter a name for the Organization though).
You’ll have to go through tvOS setup again once this finishes.
Charles profile for tvos
We now have to create a profile in Apple Configurator for the tvOS to send traffic to Charles on our Mac:
Double click the tvOS device again in Apple Configurator.
Click on File in the menu and select New Profile.
Name the profile and leave the fields in the General tab as they are.
Click on the Global HTTP Proxy tab then select Configure.
Enter the IP of your Mac with port 8888.
Click on the Certificates tab and then select Configure.
Select your Charles SSL Certificate and click Open.
Click on the Wifi tab and then select Configure.
Enter the name of your network and select Manual under Proxy setup. Once again, enter the IP of your Mac with port 8888.
Under Security Type select WPA/WPA 2 Personal and enter the password for the network.
Now we need to save the profile by opening File in the menu at the top and clicking on Save. We need to add .mobileconfig at the end of the name when saving.
Add the profile to the tvOS. Click the Add button at the top left of the Apple Configurator app then select Profiles. Choose the profile you made and click on Add.
tvos 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.