啟動廣告檢查器
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
測試廣告整合功能前,您必須先在應用程式中啟動廣告檢查器。
本頁說明如何透過偵錯選單啟動廣告檢查器,以及如何以程式輔助方式啟動。
必要條件
繼續操作前,請先完成下列事項:
- 完成「必要條件」中的所有項目,建立 Ad Manager 帳戶、設定測試裝置、初始化 Google Mobile Ads SDK,並安裝最新版本。
選擇推出選項
您可以透過下列方式啟動廣告檢查器:
- 應用程式偵錯選單中的啟動按鈕,可使用您在廣告檢查器設定中選取的手勢。
- 透過 Google Mobile Ads SDK 以程式輔助方式進行。
如要透過偵錯選單啟動廣告檢查器,您不需要對應用程式進行任何變更。詳情請參閱「檢查行動應用程式廣告放送情形」。
操作步驟如下:
- 找出 Ad Manager 聯播網放送的廣告。
- 按住廣告即可開啟偵錯選單。
- 選取「開啟廣告檢查器」。
如果沒有連結裝置,可能需要登入 Ad Manager 帳戶。
您也可以在偵錯設定中選取「廣告檢查器設定」,然後選擇開啟廣告檢查器的手勢。
以程式輔助方式啟動
執行下列指令,啟動廣告檢查器:
Java
MobileAds.openAdInspector(
context,
new OnAdInspectorClosedListener() {
public void onAdInspectorClosed(@Nullable AdInspectorError error) {
// Error will be non-null if ad inspector closed due to an error.
}
});
Kotlin
MobileAds.openAdInspector(context) { error ->
// Error will be non-null if ad inspector closed due to an error.
}
這個方法適用於以程式輔助方式註冊的測試裝置。詳情請參閱「啟用測試裝置」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[],[],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/ad-inspector/launch-ad-inspector \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/ad-inspector/launch-ad-inspector \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/ad-inspector/launch-ad-inspector \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/ad-inspector/launch-ad-inspector \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nBefore you test your ad integration, you must launch ad inspector in your app.\nThis page covers how to launch ad inspector\nthrough the debug menu and how to launch\nprogrammatically.\n\nPrerequisites\n\nBefore you continue, do the following:\n\n- Complete all items in the initial [Prerequisites](/ad-manager/mobile-ads-sdk/android/ad-inspector#prerequisites) to create an Ad Manager account, set your test device, initialize Google Mobile Ads SDK, and install the latest version.\n\nChoose a launch option\n\nYou can launch ad inspector in the following ways:\n\n- The launch button from the debug menu within your app to use the gesture that you selected in the ad inspector settings.\n- Programmatically through the Google Mobile Ads SDK.\n\nLaunch using the debug menu\n\nTo launch ad inspector through the debug menu, you don't require further\nchanges on your app. For more details, see\n[Inspect mobile app ad delivery](//support.google.com/admanager/answer/7180401).\n\nComplete the following steps:\n\n1. Find an ad served in your Ad Manager network.\n2. Touch and hold the ad to open the debug menu.\n3. Select **Open ad inspector**.\n\nIf you didn't [link your device](/ad-manager/mobile-ads-sdk/android/debug#link_your_device), you might\nneed to sign in to your Ad Manager account.\n\nFrom the debug settings, you can also select **Ad inspector settings** and\nchoose a gesture that can open ad inspector.\n\nLaunch programmatically\n\nLaunch ad inspector by running the following: \n\nJava \n\n MobileAds.openAdInspector(\n context,\n new OnAdInspectorClosedListener() {\n public void onAdInspectorClosed(@Nullable AdInspectorError error) {\n // Error will be non-null if ad inspector closed due to an error.\n }\n }); \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/java/advanced/APIDemo/app/src/main/java/com/google/android/gms/snippets/AdInspectorSnippets.java#L28-L34\n\nKotlin \n\n MobileAds.openAdInspector(context) { error -\u003e\n // Error will be non-null if ad inspector closed due to an error.\n } \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/kotlin/advanced/APIDemo/app/src/main/java/com/google/android/gms/snippets/AdInspectorSnippets.kt#L25-L27\n\nThis method works for test devices registered programmatically. For more details, see\n[Enable test devices](/ad-manager/mobile-ads-sdk/android/test-ads#enable_test_devices)."]]