The Command and Control (CaC) Tool is a functional web sender for developers to test and debug a Web Receiver application.
Developers can use the CaC Tool to:
- Launch a Web Receiver app on a Cast-enabled device and send a load request to start media playback.
- Simulate voice commands sent by Google Assistant to the Web Receiver.
- Capture logs from Cast Debug Logger and control the Web Receiver debug overlay.
Launch Web Receiver app
There are two ways to launch your Web Receiver with the CaC Tool:
To start a new Cast session:
- Open the CaC Tool, enter your Web Receiver App ID and click the SET APP ID button.
Click on the Cast button and select a device to launch the Web Receiver on a remote Cast-enabled device.
To join an existing Cast session:
Get the running Cast session ID by using the following codes:
From the Web Receiver side, use the following method to get session ID in the Chrome Remote Debugger console:
Or to get the session ID from a connected web sender, use the following method:
Enter the session ID in the CaC Tool and click the RESUME button.
When the CaC Tool is connected to the Web Receiver app, the Cast button appears with a filled frame shape. The Web Receiver app ID and session ID are also displayed at the top of the tool.
Load media from either your sender app or the CaC Tool.
To start media playback on your Web Receiver, cast your sender app to the same Cast-enabled device and send a load request from your sender app to the Web Receiver.
The CaC Tool also provides multiple ways to send a load request to the Web Receiver app:
Load by entity (voice casting)
When users initiate media playback through Google Assistant, Google Assistant uses Command and Control (CaC) messages to send user credentials and entity to your Web Receiver.
The CaC Tool simulates voice casting and sends a load request with
Load by content
The CaC Tool can also simulate your app sending a load request with
When a media playback starts, the CaC Tool receives Media Status messages from your Web Receiver app and displays them on the MEDIA STATUS tab.
Custom Load Request
Click Switch to Custom Load View under the LOAD MEDIA tab to test your own
Load Request objects that are sent to your receiver application, and use the
Custom Load Request object field to copy-paste or build your own JSON object.
The editor supports the use of Tab key for indentation and formatting.
Test voice commands
The CaC Tool also simulates voice commands sent by Google Assistant to your Web Receiver app. You can test if the media commands that your app supported are working properly. Non-supported media commands must be handled with appropriate error type and error reasons.
Inspect and control Cast Debug Logger
If your Web Receiver app enables Cast Debug Logger, the CaC Tool captures the log messages and controls the Web Receiver debug overlay.
Use the following buttons to control the Web Receiver and log messages:
- Web Receiver App ID
- Clear Cache and Stop Web Receiver - Reload the Web Receiver app and stop casting
- Web Receiver Debug Overlay
- Show - Toggle the debug overlay on the Web Receiver
- Clear - Clear log messages on the Web Receiver debug overlay
- Log Message Controls
- Insert Message - Insert comments or dividers to the log area
- Download Log - Save log messages
- Clear Log - Clear log messages on the log area
- Log Messages
- Custom Tags - Click the checkbox to filter log messages
Following tags might appear under the Custom Tags. These are added by the CaC Tool to show and filter important logs or messages pertaining to the debugging session:
- MEDIA - Messages successfully sent over the Media namespace
- MEDIA-ERROR - Error occurred while sending, or in response to messages sent over the Media namespace
- CAC - Messages successfully sent over the CAC namespace
- CAC-ERROR - Error occurred while sending, or in response to messages sent over the CAC namespace
- PLAYING - Log displaying the result when the What’s Playing button is clicked in the CaC Tool
- USER - Log displaying custom message entered by User with Insert Message button in CaC Tool
Test Cast Connect
To test Cast Connect, perform the following steps before establishing a session:
- Enter the Receiver App ID associated with your Cast Connect-enabled receiver and click Set App ID.
- Click on Show Android TV Options button.
- Check androidReceiverCompatible checkbox. If your receiver doesn’t require
Launch Credentialsto be set, or you want to test what happens in case it is not set, you can stop here and continue to Step 5.
- (Optional) Enter the
Launch Credentialsand click on the Set Launch Credentials button in order to set the launch credentials for the Cast Connect session.
- Start a cast session by clicking on the Cast icon in the header or through the Cast menu in your Chrome browser.
Your Android TV application should now launch on your device.