Uruchom inspektora reklam
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wybierz platformę:
Android
iOS
Unity
Flutter
Zanim przetestujesz integrację reklam, musisz uruchomić inspektora reklam w aplikacji.
Na tej stronie znajdziesz informacje o tym, jak uruchomić inspektora reklam
za pomocą gestów
i programowo.
Wymagania wstępne
Zanim przejdziesz dalej:
- Aby utworzyć konto AdMob, skonfigurować urządzenie testowe, zainicjować pakiet SDK do reklam mobilnych Google i zainstalować najnowszą wersję, wykonaj wszystkie czynności opisane w sekcji Wymagania wstępne.
Wybieranie opcji uruchomienia
Inspektora reklam możesz uruchomić na te sposoby:
- Użyj gestu wybranego w interfejsie AdMob po zarejestrowaniu urządzenia testowego. Więcej informacji znajdziesz w artykule Konfigurowanie urządzenia testowego.
- programowo za pomocą pakietu SDK do reklam mobilnych Google.
Uruchamianie za pomocą gestów
Aby uruchomić inspektora reklam za pomocą gestu, wykonaj gest (np. dwukrotne szybkie poruszenie lub potrząśnięcie), który został skonfigurowany w interfejsie AdMob na urządzeniu testowym. Więcej informacji znajdziesz w artykule Testowanie aplikacji za pomocą inspektora reklam.
Po ustawieniu gestu w interfejsie AdMob poczekaj, aż zmiany zostaną wprowadzone. Wyślij żądanie reklamy za pomocą pakietu SDK do reklam mobilnych Google, aby zarejestrować ustawienie gestu na urządzeniu testowym. Jeśli wykonanie gestu nie spowoduje otwarcia inspektora reklam, spróbuj wczytać reklamę, ponownie uruchomić aplikację i ponownie przetestować gest.
Uruchamianie automatyczne
Uruchom inspektora reklam, wykonując te czynności:
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.
}
Ta metoda działa w przypadku urządzeń testowych zarejestrowanych programowo lub w interfejsie AdMob.
Więcej informacji znajdziesz w artykule Włączanie urządzeń testowych.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-09-02 UTC.
[null,null,["Ostatnia aktualizacja: 2025-09-02 UTC."],[],[],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/android/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 the Google Mobile Ads SDK.\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\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\nprogrammatically or in the AdMob UI.\nFor more details, see\n[Enable test devices](/admob/android/test-ads#enable_test_devices)."]]