디버깅하려면 SDK의 디버그 옵션 메뉴와 상호작용해야 합니다.
메뉴를 여는 데 권장되는 방법은
사용자 액션에 따라 트리거할 수 있습니다.
Swift
@IBActionfuncopenDebugOptions(sender:AnyObject){// TODO: Replace YOUR_AD_UNIT_ID with your own ad unit ID.letdebugOptionsViewController=DebugOptionsViewController(adUnitID:"YOUR_AD_UNIT_ID")self.present(debugOptionsViewController,animated:true,completion:nil)}
Objective-C
-(IBAction)openDebugOptions:(id)sender{// TODO: Replace YOUR_AD_UNIT_ID with your own ad unit ID.GADDebugOptionsViewController*debugOptionsViewController=[GADDebugOptionsViewControllerdebugOptionsViewControllerWithAdUnitID:@"YOUR_AD_UNIT_ID"];[selfpresentViewController:debugOptionsViewControlleranimated:YEScompletion:nil];}
Ad Manager 계정에서 유효한 광고 단위이면
디버그 옵션 메뉴
디버그 메뉴가 닫히면 알림 받기
프로그래매틱 방식으로 디버그 옵션 메뉴를 여는 경우
알림을 받도록 GADDebugOptionsViewControllerDelegate 구현
뷰 컨트롤러가 닫힐 때. 이렇게 하려면
다음과 같이 위임을 따릅니다.
다음 단계를 따르세요.
연결된 기기로 광고 소재를 푸시할 수 있습니다.
푸시된 광고 소재가 활성 광고 항목의 일부인지 확인하세요.
타겟팅해야 합니다.
프런트 엔드에서 광고 소재를 푸시한 후
옵션 메뉴를 다시 열고 Creative Preview를 선택합니다.
다시 시도합니다 이 단계를 통해 SDK는 Ad Manager를 다시 확인하여
기기 연결에 성공했으며
확인할 수 있습니다 이전에 기기 연결에 성공한 경우
디버그 메뉴가 즉시 닫힙니다. 실패하면
계정을 다시 연결하라는 메시지가 표시됩니다.
마지막으로 미리 보려는 슬롯에 대해 광고를 로드하여 광고 소재를 확인합니다.
게재 검사기
앱 문제 해결 시작 따르기
몇 가지 단계를 수행했습니다. 단계를 성공적으로 완료하면
요청이 Ad Manager 프런트엔드에 표시되며 이 페이지에서 광고에 대한 자세한
표시됩니다.
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThis guide explains how to debug ad serving in your mobile app using in-app preview and the Delivery Inspector.\u003c/p\u003e\n"],["\u003cp\u003eIn-app preview lets you see your own creatives rendered within your app for testing and verification.\u003c/p\u003e\n"],["\u003cp\u003eThe Delivery Inspector provides information on which ads were delivered to help troubleshoot unexpected ad behavior.\u003c/p\u003e\n"],["\u003cp\u003eTo use these tools, you need to prepare your app by integrating necessary code, link your device to your Ad Manager account, and push creatives for previewing.\u003c/p\u003e\n"]]],["This guide details how to use in-app preview and the Delivery Inspector for ad debugging. To begin, add a function to your app to open the SDK's debug options menu. Link your device via the \"Creative Preview\" option within this menu and log into Ad Manager. Subsequently, push a creative to your linked device from Ad Manager and re-select \"Creative Preview\" to verify device linking. Finally load the ad in the ad slot to see your creative. To troubleshoot ad delivery use the Delivery Inspector.\n"],null,["# Creative Preview & Delivery Inspector\n\nThis guide shows how to debug ad serving using in-app preview and the\nDelivery Inspector.\n\n[In-app preview](//support.google.com/admanager/answer/7160685)\nlets you see your own creatives rendered within your mobile app.\nThis preview is especially useful for publishers who have creatives\nthat interact with the app, have unique behavior, or rely on the app\nfor some of their rendering (including native creatives and MRAID).\n\nThe [Delivery\nInspector](//support.google.com/admanager/answer/7449957)\ngives information on which ads were delivered. When unexpected ads deliver,\nuse the Delivery Inspector to find out why.\n\nPrerequisites\n-------------\n\n- Version 7.13.1 or higher of the Google Mobile Ads SDK\n- Access to a Google Ad Manager account\n- Complete [Get Started](/ad-manager/mobile-ads-sdk/ios/quick-start)\n\nPrepare your app\n----------------\n\nDebugging requires interaction with the SDK's debug options menu.\nThe recommended way to open the menu is to include the function\nbelow in your app, and trigger it based on a user action: \n\n### Swift\n\n @IBAction func openDebugOptions(sender: AnyObject) {\n // TODO: Replace YOUR_AD_UNIT_ID with your own ad unit ID.\n let debugOptionsViewController = DebugOptionsViewController(adUnitID: \"YOUR_AD_UNIT_ID\")\n self.present(debugOptionsViewController, animated: true, completion: nil)\n }\n\n### Objective-C\n\n - (IBAction)openDebugOptions:(id)sender {\n // TODO: Replace YOUR_AD_UNIT_ID with your own ad unit ID.\n GADDebugOptionsViewController *debugOptionsViewController =\n [GADDebugOptionsViewController debugOptionsViewControllerWithAdUnitID:@\"YOUR_AD_UNIT_ID\"];\n [self presentViewController:debugOptionsViewController animated:YES completion:nil];\n }\n\nAny valid ad unit from your Ad Manager account is sufficient to open the\ndebug options menu.\n| **Note:** Another way to open the menu is to do a swipe gesture on the creative, but it doesn't work for all ad formats such as native ads, and you must be careful to not click the ad when attempting to swipe. Calling the method above is much more robust.\n\nGet notified when the debug menu closes\n---------------------------------------\n\nWhen opening the debug options menu programmatically, you may choose\nto implement `GADDebugOptionsViewControllerDelegate` to be notified\nwhen the view controller is dismissed. To do this, make your class\nconform to the delegate: \n\n### Swift\n\n```swift\nimport GoogleMobileAds\n \nclass ViewController: UIViewController, GADDebugOptionsViewControllerDelegate {\n}\n```\n\n### Objective-C\n\n```objective-c\n@import GoogleMobileAds;\n \n@interface ViewController : UIViewController \u003cGADDebugOptionsViewControllerDelegate\u003e {\n}\n \n@end\n```\n\nSet the delegate on your `GADDebugOptionsViewController`: \n\n### Swift\n\n```swift\n@IBAction func openDebugOptions(sender: AnyObject) {\n let debugOptionsViewController = GADDebugOptionsViewController(adUnitID: \"YOUR_AD_UNIT_ID\")\n debugOptionsViewController.delegate = self\n self.present(debugOptionsViewController, animated: true, completion: nil)\n}\n```\n\n### Objective-C\n\n```objective-c\n- (IBAction)openDebugOptions:(id)sender {\n GADDebugOptionsViewController *debugOptionsViewController =\n [GADDebugOptionsViewController debugOptionsViewControllerWithAdUnitID:@\"YOUR_AD_UNIT_ID\"];\n debugOptionsViewController.delegate = self;\n [self presentViewController:debugOptionsViewController animated:YES completion:nil];\n}\n```\n\nFinally, implement the delegate: \n\n### Swift\n\n func debugOptionsViewControllerDidDismiss(controller: GADDebugOptionsViewController) {\n print(\"Debug options view controller dismissed.\")\n }\n\n### Objective-C\n\n - (void)debugOptionsViewControllerDidDismiss:(GADDebugOptionsViewController *)controller {\n NSLog(@\"Debug options view controller dismissed.\");\n }\n\nLink your device\n----------------\n\nAfter adding the capability to open the debug options menu, run your\napp and trigger the function above. The following menu opens:\n\nSelect **Creative Preview** to link your device. A browser opens\nand automatically navigates you to a browser to log in to Ad Manager. After\nsuccessfully logging in, name your device to register it with your\nAd Manager account, and click **Verify**.\n\n| **Note:** `SFSafariViewController` is opened on iOS 9 and above, while `Safari` is opened on iOS 8 and below.\n\nYou have successfully linked your device! At this point, you can\nsee your device linked in the [Ad Manager front-end](//www.google.com/dfp).\nYou can also [allow others to access your\ndevices](//support.google.com/admanager/answer/7160685#access).\n\nIn-app preview\n--------------\n\nFollow the steps to\n[push a creative to your linked device](//support.google.com/admanager/answer/7160685#push).\nMake sure that the pushed creative is part of an active line item\ntargeted to the ad slot where you want to see the creative.\n\nAfter pushing a creative from the front-end, trigger the debug\noptions menu on your device again, and select **Creative Preview**\nagain. This step lets the SDK check Ad Manager again to verify that the\ndevice linking was successful and to get some information about\nwhich creative you pushed. If device linking was previously successful,\nthe debug menu closes immediately. If it was unsuccessful,\nyou're prompted to link your account again.\n\nFinally, load an ad for the slot you wish to preview to see your creative!\n\nDelivery Inspector\n------------------\n\nFollow the [Begin app troubleshooting](//support.google.com/admanager/answer/7180401)\nsteps to troubleshoot your app. If you complete the steps successfully, the\nrequest will show up in the Ad Manager frontend and you can view more info about the ad\nthat served."]]