debugging for LG Part 2
set up
Debugging for LG is still very easy. We are assuming that you already have the Visual Studio & CLI apps previously set up and connected to the TV, that the app you want to test is installed on the LG TV, and that the LG is currently in dev mode. There are also 2 ways you can debug: via Visual Studio Code with a browser or via CLI with a browser.
Make sure your LG and PC are on the same network.
Launch your LG app in test.
Visual Studio Code
While you have the VS Code app open on your PC, right click on the app name and select Debug.
A small window will open in the bottom right - copy the address displayed.
Open Chrome or Edge or any browser and paste the URL into the address bar then hit enter.
Click on the webapp link.
A page with the debugger will open now and if we click on the network tab, the traffic will start to appear for the app.
You can save the traffic by right clicking anywhere and then selecting Save all as HAR with content. Rename the file something appropriate and put .har at the end. Click Save.
You can open this log in Charles afterwards.
CLI
Open the CLI app on your PC.
Type ares-setup-device —list to make sure your TV is set to default (otherwise you may have issues).
Type ares-install —device (device name) --list to get the list of app package names and find the one you want to test.
Type ares-inspect (app package name).
At this point, if the application was not open it will be launched and a link will appear in Powershell (or Command Prompt).
Copy this link.
Open your web browser and copy paste that link into the address bar.
Click on the link that appears in the browser.
Now we can see the network traffic.
If we right click anywhere in the calls we can Copy All as .HAR.
Open the notepad app on your PC and paste that copied info into it.
Click Save As and then save the file as a .HAR file.