[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe Command and Control (CaC) Tool is a web sender application for developers to test and debug their Web Receiver applications.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the CaC Tool to launch Web Receiver apps, simulate voice commands, load media, and inspect logs.\u003c/p\u003e\n"],["\u003cp\u003eThe CaC Tool provides features to simulate Google Assistant interactions, manage debug overlays, and control media playback.\u003c/p\u003e\n"],["\u003cp\u003eIt also enables developers to send custom load requests and test Cast Connect functionality for Android TV applications.\u003c/p\u003e\n"]]],[],null,["The [Command and Control (CaC) Tool](https://casttool.appspot.com/cactool/) is\na functional web sender for developers to test and debug a Web Receiver application.\n\nDevelopers can use the CaC Tool to:\n\n- Launch a Web Receiver app on a Cast-enabled device and send a load request to start media playback.\n- Simulate [voice commands](/cast/docs/caf_receiver/core_features#voice_commands) sent by Google Assistant to the Web Receiver.\n- Capture logs from [Cast Debug Logger](/cast/docs/debugging/cast_debug_logger) and control the Web Receiver debug overlay.\n\nLaunch Web Receiver app\n\nThere are two ways to launch your Web Receiver with the CaC Tool:\n\n1. To start a new Cast session:\n\n 1. Open the CaC Tool, enter your Web Receiver App ID and click the **SET APP ID** button.\n 2. Click on the Cast button and select a device to launch the Web Receiver\n on a remote Cast-enabled device.\n\n2. To join an existing Cast session:\n\n 1. Get the running Cast session ID by using the following codes:\n\n From the Web Receiver side, use the following method to get session ID in\n the [Chrome Remote Debugger](/cast/docs/debugging/remote_debugger) console: \n\n cast.framework.CastReceiverContext.getInstance().getApplicationData().sessionId;\n\n Or to get the session ID from a connected Web Sender, use the following\n method: \n\n cast.framework.CastContext.getInstance().getCurrentSession().getSessionId();\n\n 2. Enter the session ID in the CaC Tool and click the **RESUME** button.\n\nWhen the CaC Tool is connected to the Web Receiver app, the Cast button appears\nwith a filled frame shape. The Web Receiver app ID and session ID are also\ndisplayed at the top of the tool.\n\nLoad media\n\nLoad media from either your sender app or the CaC Tool.\n\nSender app\n\nTo start media playback on your Web Receiver, cast your sender app to the\nsame Cast-enabled device and send a load request from your sender app to the\nWeb Receiver.\n| **Note:** Make sure the sender app is using the same Web Receiver application ID as the one in the CaC Tool.\n\nCaC Tool\n\nThe CaC Tool also provides multiple ways to send a load request to the Web\nReceiver app:\n\nLoad by entity (voice casting)\n\nWhen users initiate media playback through Google Assistant, Google Assistant\nuses Command and Control (CaC) messages to send user credentials and entity to\nyour Web Receiver.\n\nThe CaC Tool simulates voice casting and sends a load request with `credentials`\nand `entity`.\n\nLoad by content\n\nThe CaC Tool can also simulate your app sending a load request with `Content ID`\nor `Content Url`.\n| **Note:** We suggest you use `entity` in your implementation for both your sender and Web Receiver apps. For more information, see [Tip: Loading media using contentId, contentUrl and entity](/cast/docs/caf_receiver/core_features#tip_loading_media_using_contentid_contenturl_and_entity).\n\nWhen a media playback starts, the CaC Tool receives Media Status messages from\nyour Web Receiver app and displays them on the **MEDIA STATUS** tab.\n\nCustom Load Request\n\nIf you would like to test your receiver using your own `Load Request` objects, use\nthe **Custom Load Request** field under the **LOAD MEDIA** tab. First, select\nthe type of request from the **Select Request Type** radio buttons and then copy-paste\nor build your own JSON object.\n| **Note:** The editor supports the use of `Tab` key for indentation and formatting.\n\nTest voice commands\n\nThe CaC Tool also simulates\n[voice commands](/cast/docs/caf_receiver/core_features#voice_commands) sent by\nGoogle Assistant to your Web Receiver app. You can test if the media commands\nthat your app supported are working properly. Non-supported media commands must\nbe handled with appropriate\n[error type and error reasons](/cast/docs/caf_receiver/core_features#error_handling).\n\nInspect and control Cast Debug Logger\n\nIf your Web Receiver app enables\n[Cast Debug Logger](/cast/docs/debugging/cast_debug_logger), the CaC Tool\ncaptures the log messages and controls the Web Receiver debug overlay.\n\nUse the following buttons to control the Web Receiver and log messages:\n\n- Web Receiver App ID\n - **Clear Cache and Stop Web Receiver** - Reload the Web Receiver app and stop casting\n- Web Receiver Debug Overlay\n - **Show** - Toggle the debug overlay on the Web Receiver\n - **Clear** - Clear log messages on the Web Receiver debug overlay\n- Log Message Controls\n - **Insert Message** - Insert comments or dividers to the log area\n - **Download Log** - Save log messages\n - **Clear Log** - Clear log messages on the log area\n- Log Messages\n - **Custom Tags** - Click the checkbox to filter log messages\n\nFollowing tags might appear under the **Custom Tags**. These are added by the\nCaC Tool to show and filter important logs or messages pertaining to the\ndebugging session:\n\n- **MEDIA** - Messages successfully sent over the Media namespace\n- **MEDIA-ERROR** - Error occurred while sending, or in response to messages sent over the Media namespace\n- **CAC** - Messages successfully sent over the CAC namespace\n- **CAC-ERROR** - Error occurred while sending, or in response to messages sent over the CAC namespace\n- **PLAYING** - Log displaying the result when the **What's Playing** button is clicked in the CaC Tool\n- **USER** - Log displaying custom message entered by User with **Insert Message** button in CaC Tool\n\nTest Cast Connect\n\nTo test Cast Connect, perform the following steps before establishing a session:\n\n1. Enter the Receiver App ID associated with your Cast Connect-enabled receiver and click **Set App ID**.\n2. Click on **Show Android TV Options** button.\n3. Check **androidReceiverCompatible** checkbox. If your receiver doesn't require `Launch Credentials` to be set, or you want to test what happens in case it is not set, you can stop here and continue to Step 5.\n4. (Optional) Enter the `Launch Credentials` and click on the **Set Launch\n Credentials** button in order to set the launch credentials for the Cast Connect session.\n5. Start a cast session by clicking on the Cast icon in the header or through the Cast menu in your Chrome browser.\n\nYour Android TV application should now launch on your device.\n| **Note:** CaC Tool is unable to fetch any logs from your Android TV device. In order to debug your Android TV app and see any relevant logs, use `adb` through your terminal or Android Studio, as you normally would in order to access the logs and debug your app."]]