Use the Chrome Remote Debugger to debug a Cast application.
Chrome Remote Debugger
Launch Chrome Remote Debugger for a particular Google Cast device as follows:
To debug Cast apps on an Android TV device, see Android TV: Debugging.
To debug a receiver app on Google Cast devices, do the following:
Both the application and device must be registered in order for you to perform debugging.
Start your sender app and cast to the Google Cast device to load the receiver app for debugging. Make sure your sender and receiver devices are connected to the same network.
There are two ways to connect to your device for remote debugging:
In the Chrome browser, enter the following in the address field to go to the Chrome inspector:
A list of Cast-enabled devices on that network appears.
Select the device for the receiver app you want to debug by clicking its
An inspector window should open, enabling you to remotely debug the receiver app.
Directly to the device's 9222 port
In the Chrome browser, enter the following in the address field to go to the device you are debugging directly. This may be faster than the Chrome Inspector if you have many devices on your network:
<device IP address>:9222
The device IP address can be found by selecting the device in the Google Home app, going to settings, and looking under the Information section.
Select the session you would like to debug by clicking its
If the Chrome Remote Debugger does not populate, select the icon to the left of the address bar and select
site settings. Scroll to the bottom of the settings and change the setting for
In the Chrome Remote Debugger console, enable debug logging, by entering the following:
When your receiver is torn down (lifecycle ended), the debugger will become inactive with a warning message along the top. At this point you can no longer interact with the debugger. To restart debugging, you must restart the receiver app and then reload the inspector.
You can add manual breakpoints to your code by using
debugger; within your
window.location.reload(true); to perform a forced reload that flushes the
cache of the receiver application.
Preserving logs between sessions
You can preserve the logs between sessions by clicking the gear icon within the debugger and checking the box next to “Preserve log upon navigation”.