測試廣告單元
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
廣告檢查器支援下列測試:
- 實際情境測試:在應用程式中的廣告單元載入廣告。您可以開啟廣告檢查器,查看廣告單元發出的請求詳細資料。
- 非實際情境測試:直接在廣告檢查器中測試廣告單元,不需前往應用程式的使用者介面。您可以一次測試多個廣告單元、非同步載入及查看測試廣告請求,並執行單一廣告來源測試。
執行非實際情境測試時,請求不會包含在應用程式使用者介面中執行的參數,包括兒童導向內容設定、自訂指定目標、聯播網額外資訊和不同廣告尺寸。由於這些請求有所限制,建議您在應用程式使用者介面中使用實際情境測試。
必要條件
繼續操作前,請先執行下列工作:
- 完成初始「必要條件」的所有項目,包括建立 AdMob 帳戶、設定測試裝置、初始化 Google Mobile Ads SDK,並安裝最新版本。
- 啟動廣告檢查器。
要求測試廣告
如要在廣告檢查器中要求測試廣告,請完成下列步驟。詳情請參閱「如何在應用程式中使用廣告檢查器」一文。
實際情境:
- 在測試裝置上,前往應用程式的使用者介面,然後載入廣告。
- 開啟廣告檢查器。在「廣告單元」分頁中,找出您載入廣告的廣告單元。
- 在「SDK 請求記錄」中,查看所要求測試廣告的詳細資料。
Out-of-context:
- 在「廣告單元」分頁中,輕觸廣告單元,然後按一下「請求測試廣告」。
- 在「SDK 請求記錄」中,查看所要求測試廣告的詳細資料。

如果廣告單元格式顯示「不明」,則「要求測試廣告」會顯示為灰色。
測試單一廣告來源
廣告檢查器可限制應用程式中的廣告請求,只放送來自單一出價或刊登序列廣告來源的廣告。您可以透過這個做法,確認已正確整合第三方轉接程式,且廣告來源正常放送。
如要測試單一廣告來源,請完成下列步驟:
在「廣告檢查器」中,按一下「單一廣告來源測試」切換鈕。隨即會顯示「單一廣告來源測試」對話方塊:
Android
|
iOS
|
選取要測試的廣告來源。接著您會看見「強制重新啟動應用程式」頁面:

單一廣告來源測試設定會套用至日後提出的所有廣告請求。
這項測試不適用於該工作階段中先前快取的廣告。
套用單一廣告來源測試時,建議您強制重新啟動應用程式。此做法可讓快取廣告失效不顯示,您選的廣告來源則會收到請求。
重新啟動應用程式後,所有廣告單元刊登位置都會嘗試顯示所選廣告來源的廣告。在執行單一廣告來源測試時啟動廣告檢查器,會顯示執行中的測試廣告來源:

在單一廣告來源測試模式中,無論所選廣告來源是否完成出價或刊登序列設定,所有廣告請求都會嘗試透過該廣告來源供應廣告。如果要測試的廣告來源未對廣告單元設定出價或刊登序列,您會收到下列錯誤訊息:
Ad Unit has no applicable adapter for single ad source testing on network: AD_SOURCE_ADAPTER_CLASS_NAME
如要確認廣告來源是否在您開始單一廣告來源測試後供應廣告請求,請輕觸廣告單元以查看 SDK 請求記錄。如果廣告來源無法載入廣告,系統會顯示錯誤訊息並說明錯誤,例如「Adapter failed to initialize
」。
如果您已在刊登序列中加入所選廣告來源的多個例項,系統會顯示該廣告來源的各個呼叫例項。這個程序會持續顯示,直到廣告供應完成,或刊登序列未供應廣告就結束為止。
停止單一廣告來源測試
如要停止測試,請完成下列步驟:
- 在「廣告檢查器」中,點按關閉「單一廣告來源測試」切換鈕。隨即會顯示「停止單一廣告來源測試?」對話方塊。
輕觸「停止測試」。

如果成功,「強制重新啟動應用程式」上方會顯示確認訊息:

如要撤銷測試廣告來源的快取廣告,建議在停止測試後,強制重新啟動應用程式。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-02 (世界標準時間)。
[null,null,["上次更新時間:2025-09-02 (世界標準時間)。"],[],[],null,["Select platform: [Android](/admob/android/ad-inspector/test-ad-units \"View this page for the Android platform docs.\") [iOS](/admob/ios/ad-inspector/test-ad-units \"View this page for the iOS platform docs.\") [Unity](/admob/unity/ad-inspector/test-ad-units \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/ad-inspector/test-ad-units \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nAd inspector supports the following tests:\n\n- **In-context testing**: load ads from the ad units in your app. You can open ad inspector to view details on requests made from ad units.\n- **Out-of-context testing**: test your ad unit directly in ad inspector without navigating to your app's UI. You can test multiple ad units at once, asynchronously load and view your test ad requests, and perform single ad source tests.\n\nWhen running an out-of-context test, your requests don't carry the parameters\nto run in your app's UI, including child-directed treatment configuration,\ncustom targeting, network extras, and different sizes. Due to the limitation of\nthese requests, we recommend you use in-context testing in your app's UI.\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- [Launch ad inspector](/admob/flutter/ad-inspector/launch-ad-inspector).\n\nRequest a test ad\n\nTo request a test ad in ad inspector, complete the following steps. For more\ndetails, see\n\n[How to use ad inspector in your app](//support.google.com/admob/answer/13063114).\n\n\n- **In-context**:\n\n 1. On a test device, navigate to your app's UI and load an ad.\n 2. Open ad inspector. In the **Ad unit** tab, find the ad unit where you loaded the ad.\n 3. In **SDK request log**, view details on your requested test ad.\n- **Out-of-context**:\n\n 1. In the **Ad unit** tab, tap on your ad unit and click **Request test ad**.\n 2. In **SDK request log**, view details on your requested test ad.\n\nIf the ad unit format shows **Unknown** , you see **Request test ad** greyed\nout.\n\nTest a single ad source\n\nAd inspector can restrict ad requests in your app to serve ads from a single\nbidding or waterfall ad source. This approach lets you verify that you've\ncorrectly integrated with the third-party adapter, and the ad source serves\nas expected.\n\nTo test a single ad source, complete the following steps:\n\n1. In **Ad inspector** , click the **Single ad source test** toggle. A\n **Single ad source test** dialog appears:\n\n\n |---------|-----|\n | Android | iOS |\n\n \u003cbr /\u003e\n\n\n2. Select an ad source to test. Afterwards, you receive the\n **Force restart app** page:\n\nThe single ad source test setting applies to any future ad requests you make.\nThis test doesn't apply to previously cached ads in that session.\nWe recommend you to force restarting your app when applying a single ad source\ntest. This approach invalidates cached ads that might display instead of\nyour chosen ad source receiving a request.\n\nAfter restarting your app, all ad unit placements attempt to show an ad from the\nselected ad source. Launching ad inspector when a single ad source test is\nactive shows the active test ad source:\n\nIn single ad source test mode, all ad requests attempt to fill with the\nselected ad source, regardless of whether that ad source was configured for\nbidding or waterfall. If the ad source you're testing is not set up for bidding\nor waterfall for the ad unit, you receive the following error message: \n\n Ad Unit has no applicable adapter for single ad source testing on network: \u003cvar translate=\"no\"\u003eAD_SOURCE_ADAPTER_CLASS_NAME\u003c/var\u003e\n\nTo verify whether the ad source filled the ad requests after you start a single\nad source test, tap an ad unit to view the SDK request log. If the ad source\nfailed to load an ad, an error message appears describing the error, such\nas `Adapter failed to initialize`.\n\nIf you've added multiple instances of the selected ad source to a waterfall, you\nsee each call instance to the ad source. This process renders until the ad is\neither filled or the waterfall ends without a fill.\n\nStop a single ad source test\n\nTo stop the test, complete the following steps:\n\n1. In **Ad inspector** , click off the **Single ad source test** toggle. The **Stop single ad source test?** dialog appears.\n2. Tap **Stop test**.\n\n\n If successful, a confirmation message appears over **Force restart app**:\n\nTo revoke cached ads for the tested ad source, we recommend you to force\nrestart the app after stopping the test."]]