媒體工作階段驗證工具
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Media Session Validator 是一項工具,可透過簡單的自動化方式,驗證 Android TV 應用程式與 Media Session 的整合情形。這也會驗證 Android TV 應用程式支援 Cast Connect 的必要條件。
下載及安裝 APK
在 Android TV 裝置上啟用 Android Debug Bridge (ADB) 偵錯功能,連線至裝置,然後安裝 APK。
上次更新日期:2021 年 6 月 21 日
下載 Media Session Validator APK
操作說明
為 Media Session Validator 啟用「Notification Access」權限。
依序前往「設定」>「應用程式」>「特殊應用程式存取權」>「通知存取權」>「Media Session Validator」
開啟媒體工作階段驗證工具,然後選取「開始驗證」:

返回 Android TV 主畫面,然後開啟媒體應用程式。
在應用程式中選取任何媒體內容,然後開始播放。
驗證器應自動開始測試及執行媒體指令:

驗證工具完成測試後,請返回 Media Session Validator 應用程式查看結果。
選取「檢查驗證結果」,然後選取應用程式,即可開啟結果畫面:

結果畫面會顯示含有說明的測試案例清單:

如果您看到任何失敗或警告測試案例,請查看說明並修正應用程式中的任何問題,然後再次執行驗證。
如要查看或分享測試結果,您也可以透過 ADB 下載驗證報告:

除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eMedia Session Validator is a tool used to ensure your Android TV app correctly integrates with Media Session and meets the requirements for Cast Connect support.\u003c/p\u003e\n"],["\u003cp\u003eTo use the tool, download and install the Media Session Validator APK, enable Notification Access for it, and then initiate validation within the app.\u003c/p\u003e\n"],["\u003cp\u003eWhile your media app plays content, the validator automatically tests media commands and provides a detailed report on the results.\u003c/p\u003e\n"],["\u003cp\u003eAfter the validation process, you can review the results within the app, addressing any failed or warning test cases in your app's code.\u003c/p\u003e\n"],["\u003cp\u003eFor further analysis or sharing, you can download a comprehensive validation report using ADB.\u003c/p\u003e\n"]]],[],null,["# Media Session Validator is a tool that provides an easy and automated way\nto verify your Android TV application integration with Media Session. This also\nverifies the [prerequisites](/cast/docs/android_tv_receiver/core_features#android_tv_app%E2%80%94prerequisites)\nof supporting Cast Connect in your Android TV application.\n\nDownloading and Installing APK\n------------------------------\n\nEnable [Android Debug Bridge (adb)](https://developer.android.com/studio/command-line/adb#Enabling)\ndebugging on your Android TV device, connect to the device, and\n[install the APK](https://developer.android.com/studio/command-line/adb#move).\n\n**Last updated: June 21, 2021**\n\n[Download the Media Session Validator APK](/static/cast/docs/android_tv_receiver/mediasession-validator-1.1-20210621.apk)\n\nInstructions\n------------\n\n1. Enable **Notification Access** permission for Media Session Validator.\n\n Go to: **Settings \\\u003e Apps \\\u003e Special app access \\\u003e\n Notification access \\\u003e Media Session Validator**\n2. Open the Media Session Validator and select **Start Validation**:\n\n3. Return to the Android TV home screen and open a media app.\n\n4. Select any media content from the app and start playback.\n\n5. The validator should start testing and execute media commands automatically:\n\n6. After the validator finishes testing, go back to the Media Session Validator\n app to check the results.\n\n7. Select **Check Validation Results** and select an app to open the result screen:\n\n8. The result screen displays a list of test cases with descriptions:\n\n9. If you see any fail or warning test cases, review the description and\n fix any issues in your app, then run the validation again.\n\n10. To review or share the test results, you can also download the validation\n report via ADB:"]]