AI-generated Key Takeaways
-  Using test ads during development is important to avoid charging advertisers and risking account flagging for invalid activity. 
-  There are two methods to get test ads: using Google's demo ad units or enabling test mode for your own ad units on specific devices. 
-  Demo ad units are the quickest way to test and are not associated with your AdMob account, but must be replaced with your own ad unit IDs before publishing. 
-  Enabling test devices allows for more rigorous testing with production-looking ads using your own ad units. 
-  iOS simulators are automatically configured as test devices, while physical devices can be added programmatically or via the AdMob UI. 
This guide explains how to receive test ads in your ads integration. It is important to use test ads during development so that you can click on them without charging Google advertisers. If you click on too many ads without being in test mode, you risk your account being flagged for invalid activity.
There are two ways to get test ads:
- Use one of Google's demo ad units .
- Use your own ad unit and enable test mode .
Prerequisite
- Complete Get Started .
Demo ad units
The quickest way to enable testing is to use Google-provided demo ad units. These ad units are not associated with your AdMob account, so there's no risk of your account generating invalid traffic when using these ad units.
Here are demo ad units that point to specific test creatives for each format:
| Ad format | Demo ad unit ID | 
|---|---|
| App Open | ca-app-pub-3940256099942544/5575463023 | 
| Adaptive Banner | ca-app-pub-3940256099942544/2435281174 | 
| Fixed Size Banner | ca-app-pub-3940256099942544/2934735716 | 
| Interstitial | ca-app-pub-3940256099942544/4411468910 | 
| Rewarded Ads | ca-app-pub-3940256099942544/1712485313 | 
| Rewarded Interstitial | ca-app-pub-3940256099942544/6978759866 | 
| Native | ca-app-pub-3940256099942544/3986624511 | 
| Native Video | ca-app-pub-3940256099942544/2521693316 | 
Enable test devices (Test mode)
If you want to do more rigorous testing with production-looking ads, you can now configure your device as a test device and use your own ad unit IDs that you've created in the AdMob UI. Test devices can either be added in the AdMob UI or programmatically using Google Mobile Ads SDK.
Follow the steps below to add your device as a test device.
Add your test device in the AdMob UI
For a simple, non-programmatic way to add a test device and test new or existing app builds, use the AdMob UI. Learn how .
Add your test device programmatically
If you want to test ads in your app as you're developing, follow the steps below to programmatically register your test device.
- Load your ads-integrated app and make an ad request.
- Check the console for a message that looks like this: <Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @" 2077ef9a63d2b398840261c8221a0c9b" ]; 
-  Modify your code to set the test device ID through testDeviceIdentifiers:Swiftlet testDeviceIdentifiers = [ "2077ef9a63d2b398840261c8221a0c9b" ] MobileAds . shared . requestConfiguration . testDeviceIdentifiers = testDeviceIdentifiers . swift



