啟動廣告檢查器
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
測試廣告整合功能前,您必須先在應用程式中啟動廣告檢查器。本頁面說明如何使用手勢啟動廣告檢查器,以及如何以程式輔助方式啟動。
必要條件
繼續操作前,請先完成下列事項:
- 完成「初始必要條件」中的所有項目,建立 AdMob 帳戶、設定測試裝置、初始化 Google Mobile Ads SDK,並安裝最新版本。
選擇推出選項
您可以透過下列方式啟動廣告檢查器:
- 註冊測試裝置後,請使用在 AdMob 使用者介面中選取的手勢。詳情請參閱「設定測試裝置」。
- 透過方法以程式輔助方式建立。
使用手勢啟動
如要透過手勢啟動廣告檢查器,請對測試裝置做出您在 AdMob 使用者介面中設定的手勢,例如雙擊或搖動。詳情請參閱「使用廣告檢查器測試應用程式」。
在 AdMob 使用者介面中設定手勢後,請稍待片刻,讓系統傳播設定。透過 Google Mobile Ads SDK 發出廣告請求,向測試裝置註冊手勢設定。如果手勢無法開啟廣告檢查器,請嘗試載入廣告、重新啟動應用程式,然後再次測試手勢。
以程式輔助方式啟動
執行下列指令,啟動廣告檢查器:
MobileAds.instance.openAdInspector((error) {
// Error will be non-null if ad inspector closed due to an error.
});
這個方法適用於以程式輔助方式或在 AdMob 使用者介面中註冊的測試裝置。詳情請參閱「啟用測試裝置」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[],[],null,["Select platform: [Android](/admob/android/ad-inspector/launch-ad-inspector \"View this page for the Android platform docs.\") [iOS](/admob/ios/ad-inspector/launch-ad-inspector \"View this page for the iOS platform docs.\") [Unity](/admob/unity/ad-inspector/launch-ad-inspector \"View this page for the Unity platform docs.\") [Flutter](/admob/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\nusing gestures\nand how to launch\nprogrammatically.\n\nPrerequisites\n\nBefore you continue, do the following:\n\n- Complete all items in the initial [Prerequisites](/admob/flutter/ad-inspector#prerequisites) to create an AdMob 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- Use the gesture you selected in the AdMob UI after registering a test device. For details, see [Set up a test device](https://support.google.com/admob/answer/9691433).\n- Programmatically through a method.\n\nLaunch using gestures\n\nTo launch ad inspector with a gesture, perform the gesture, such as a double\nflick or shake, that you configured in AdMob UI for your test\ndevice. For more details, see\n[Test your app with ad inspector](https://support.google.com/admob/answer/10159602).\n\nAfter you set a gesture in the AdMob UI, allow time to propagate. Make an ad\nrequest through the Google Mobile Ads SDK to register your\ngesture setting with your test device. If performing your gesture fails to\nopen in ad inspector, try to load an ad, restart your app, and test the gesture\nagain.\n\nLaunch programmatically\n\nLaunch ad inspector by running the following: \n\n MobileAds.instance.openAdInspector((error) {\n // Error will be non-null if ad inspector closed due to an error.\n });\n\nThis method works for test devices registered\nprogrammatically or in the AdMob UI.\nFor more details, see\n[Enable test devices](/admob/flutter/test-ads#enable_test_devices)."]]