広告インスペクタを起動する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
広告の統合をテストする前に、アプリで広告インスペクタを起動する必要があります。このページでは、ジェスチャーを使って広告インスペクタを起動する方法と、プログラムで起動する方法について説明します。
前提条件
続行する前に、次の操作を行います。
- 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 の管理画面を通じて登録)で機能します。詳しくは、テストデバイスを有効にするをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-02 UTC。
[null,null,["最終更新日 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/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)."]]