Launch ad inspector

Before you test your ad integration, you must launch ad inspector in your app. This page covers how to launch ad inspector using gestures and how to launch programmatically.

Prerequisites

Before you continue, do the following:

  • Complete all items in the initial Prerequisites to create an AdMob account, set your test device, initialize Google Mobile Ads SDK, and install the latest version.

Choose a launch option

You can launch ad inspector in the following ways:

  • Use the gesture you selected in the AdMob UI after registering a test device. For details, see Set up a test device.
  • Programmatically through the Google Mobile Ads SDK.

Launch using gestures

To launch ad inspector with a gesture, perform the gesture, such as a double flick or shake, that you configured in AdMob UI for your test device. For more details, see Test your app with ad inspector.

After you set a gesture in the AdMob UI, allow time to propagate. Make an ad request through the Google Mobile Ads SDK to register your gesture setting with your test device. If performing your gesture fails to open in ad inspector, try to load an ad, restart your app, and test the gesture again.

Launch programmatically

Launch ad inspector by running the following:

Swift

GADMobileAds.sharedInstance().presentAdInspector(from: viewController) { error in
  // Error will be non-nil if there was an issue and the inspector was not displayed.
}

Objective-C

[GADMobileAds.sharedInstance presentAdInspectorFromViewController:viewController
  completionHandler:^(NSError *error) {
    // Error will be non-nil if there was an issue and the inspector was not displayed.
}];

This method works for test devices registered programmatically or in the AdMob UI. For more details, see Enable test devices.

Ensure that the view controller to this launch is fully visible on screen. For example, if you called viewDidAppear:. If the view controller passed in is in the process to display, such as when the launch is called in the view controller function viewDidLoad, the presentation of the ad inspector fails.