يوضّح هذا الدليل كيفية تلقّي إعلانات اختبارية في عملية دمج الإعلانات. من المهم استخدام الإعلانات الاختبارية أثناء التطوير حتى تتمكّن من النقر عليها بدون تحصيل رسوم من المعلِنين على Google. إذا نقرتَ على عدد كبير جدًا من الإعلانات بدون استخدام وضع الاختبار، قد يتم الإبلاغ عن حسابك بسبب النشاط غير الصالح.
أسرع طريقة لتفعيل الاختبار هي استخدام الوحدات الإعلانية التجريبية التي توفّرها Google.
هذه الوحدات الإعلانية غير مرتبطة بحسابك على AdMob، لذلك من غير المحتمل أن يُنشئ حسابك زيارات غير صالحة عند استخدام هذه الوحدات الإعلانية.
في ما يلي وحدات إعلانية تجريبية تشير إلى تصاميم إعلانات اختبارية محدّدة لكل شكل إعلان:
إذا كنت تريد إجراء اختبارات أكثر دقة باستخدام إعلانات ذات شكل نهائي، يمكنك الآن إعداد جهازك على أنّه جهاز اختباري واستخدام أرقام تعريف الوحدات الإعلانية التي أنشأتها في واجهة مستخدم AdMob.
يمكن إضافة الأجهزة الاختبارية في واجهة مستخدم AdMob أو آليًا باستخدام حزمة تطوير البرامج (SDK) لإعلانات Google على الأجهزة الجوّالة.
اتّبِع الخطوات التالية لإضافة جهازك كجهاز اختباري.
إضافة جهاز الاختبار في واجهة مستخدم AdMob
للحصول على طريقة بسيطة وغير آلية لإضافة جهاز اختباري واختبار إصدارات التطبيق الجديدة أو الحالية، استخدِم واجهة مستخدم AdMob. مزيد من المعلومات
إضافة جهاز الاختبار بطريقة آلية
إذا كنت تريد اختبار الإعلانات في تطبيقك أثناء تطويره، اتّبِع الخطوات التالية لتسجيل جهازك الاختباري آليًا.
حمِّل تطبيقك المتكامل مع الإعلانات وأرسِل طلب إعلان.
تحقَّق من وحدة التحكّم بحثًا عن رسالة مشابهة لما يلي:
<Google> To get test ads on this device, set:
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =
@[ @"2077ef9a63d2b398840261c8221a0c9b" ];
لا تعرض الوحدات الإعلانية التجريبية من Google سوى إعلانات Google. ولاختبار إعداد التوسّط، عليك استخدام أسلوب تفعيل أجهزة الاختبار.
لا تعرض الإعلانات التي يتم التوسّط فيها التصنيف وضع الاختبار. تتحمّل أنت مسؤولية التأكّد من تفعيل وضع الاختبار لكل شبكة من شبكات التوسّط حتى لا تبلغ هذه الشبكات عن حسابك بسبب النشاط غير الصالح. لمزيد من المعلومات، يُرجى الرجوع إلى دليل التوسّط الخاص بكل شبكة.
إذا لم تكن متأكدًا مما إذا كان محوّل شبكة إعلانات التوسّط يوفّر وضعًا اختباريًا، من الأفضل تجنُّب النقر على الإعلانات من تلك الشبكة أثناء التطوير. يمكنك استخدام السمة adNetworkClassName مع أي من أشكال الإعلانات لمعرفة شبكة الإعلانات التي عرضت الإعلان الحالي.
تاريخ التعديل الأخير: 2025-08-22 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-22 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis guide explains how to display test ads during development to avoid invalid activity flags on your AdMob account.\u003c/p\u003e\n"],["\u003cp\u003eYou can receive test ads using Google-provided demo ad units or by enabling test mode for your own ad units.\u003c/p\u003e\n"],["\u003cp\u003eWhen using demo ad units, remember to replace them with your own ad unit IDs before publishing your app.\u003c/p\u003e\n"],["\u003cp\u003eTo enable test mode, add your device as a test device either through the AdMob UI or programmatically using the provided code snippet.\u003c/p\u003e\n"],["\u003cp\u003eEnsure test mode is enabled for your mediation networks to prevent invalid activity concerns when testing with mediation.\u003c/p\u003e\n"]]],["To test ads, use Google's demo ad units or enable test mode with your own units. Demo units avoid account issues and offer specific IDs for various ad formats, but must be replaced before publishing. Test mode, which is necessary for mediation testing, allows production-like ads by either adding a device via the AdMob UI or programmatically, setting a device ID. Test ads show a \"Test mode\" label; mediated ads do not, requiring individual network test mode configurations to prevent invalid activity.\n"],null,["This guide explains how to receive test ads in your ads integration. It is\nimportant to use test ads during development so that you can click on them\nwithout charging Google advertisers. If you click on too many ads without being\nin test mode, you risk your account being flagged for invalid activity.\n\nThere are two ways to get test ads:\n\n1. Use one of Google's [demo ad units](#demo_ad_units).\n2. Use your own ad unit and [enable test mode](#enable_test_devices).\n\nPrerequisite\n\n- Complete [Get Started](/admob/ios/quick-start).\n\nDemo ad units\n\nThe quickest way to enable testing is to use Google-provided demo ad units.\nThese ad units are not associated with your AdMob\naccount, so there's no risk of your account generating invalid traffic when\nusing these ad units.\n| **Key Point:** Make sure you replace these IDs with your own ad unit ID before publishing your app.\n\nHere are demo ad units that point to specific test creatives for each format:\n\n| Ad format | Demo ad unit ID |\n|-----------------------------------------------------------|------------------------------------------|\n| [App Open](/admob/ios/app-open) | `ca-app-pub-3940256099942544/5575463023` |\n| [Adaptive Banner](/admob/ios/banner) | `ca-app-pub-3940256099942544/2435281174` |\n| [Fixed Size Banner](/admob/ios/banner/fixed-size) | `ca-app-pub-3940256099942544/2934735716` |\n| [Interstitial](/admob/ios/interstitial) | `ca-app-pub-3940256099942544/4411468910` |\n| [Rewarded Ads](/admob/ios/rewarded) | `ca-app-pub-3940256099942544/1712485313` |\n| [Rewarded Interstitial](/admob/ios/rewarded-interstitial) | `ca-app-pub-3940256099942544/6978759866` |\n| [Native](/admob/ios/native) | `ca-app-pub-3940256099942544/3986624511` |\n| [Native Video](/admob/ios/native/video-ads) | `ca-app-pub-3940256099942544/2521693316` |\n\nEnable test devices (Test mode)\n\nIf you want to do more rigorous testing with production-looking ads, you can\nnow configure your device as a test device and use your own ad unit IDs that\nyou've created in the AdMob UI.\n\nTest devices can either be added in the AdMob UI or programmatically using the\nGoogle Mobile Ads SDK.\n\n\nFollow the steps below to add your device as a test device.\n| **Key Point:** iOS simulators are automatically configured as test devices.\n\nAdd your test device in the AdMob UI\n\nFor a simple, non-programmatic way to add a test device and test new or existing\napp builds, use the AdMob UI. [Learn\nhow](//support.google.com/admob/answer/9691433).\n| **Key Point:** New test devices typically start serving test ads in your app within 15 minutes, but it can also take up to 24 hours.\n\nAdd your test device programmatically\n\nIf you want to test ads in your app as you're developing, follow the\nsteps below to programmatically register your test device.\n\n1. Load your ads-integrated app and make an ad request.\n2. Check the console for a message that looks like this: \n\n ```\n \u003cGoogle\u003e To get test ads on this device, set:\n GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =\n @[ @\"2077ef9a63d2b398840261c8221a0c9b\" ];\n ```\n Copy your test device ID to your clipboard.\n3. Modify your code to set the test device ID through [`testDeviceIdentifiers`](/admob/ios/api/reference/Classes/GADRequestConfiguration#testdeviceidentifiers):\n\nSwift \n\n let testDeviceIdentifiers = [\"2077ef9a63d2b398840261c8221a0c9b\"]\n MobileAds.shared.requestConfiguration.testDeviceIdentifiers = testDeviceIdentifiers \n https://github.com/googleads/googleads-mobile-ios-examples/blob/74054f811eef75fa8757c8172e3b20f765b55099/Swift/advanced/APIDemo/APIDemo/Snippets/RequestConfigurationSnippets.swift#L23-L24\n\nObjective-C \n\n NSArray *testDeviceIdentifiers = @[ @\"2077ef9a63d2b398840261c8221a0c9b\" ];\n GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = testDeviceIdentifiers; \n https://github.com/googleads/googleads-mobile-ios-examples/blob/74054f811eef75fa8757c8172e3b20f765b55099/Objective-C/advanced/APIDemo/APIDemo/Snippets/RequestConfigurationSnippets.m#L28-L29\n\n| Be sure to remove the code that sets these test devices before you release your app.\n1. Re-run your app. If the ad is a Google ad, you'll see a \\*\\*Test mode\\*\\* label centered at the top of the ad (banner, interstitial, or rewarded ad): To see the \\*\\*Test mode\\*\\* label, you need to be using an SDK version of 7.59.0 or higher. In versions 7.26.0 to 7.58.0 the label will say Test Ad. \n\n For native advanced ads, the headline asset is prepended with the string\n **Test mode**.\n\n \u003cimg class=\"screenshot\" src=\"/admob/images/native-testad-ios.png\"\n style=\"max-width:400px;\"/\u003e\n\n Ads with this **Test mode** label are safe to click. Requests, impressions, and\n clicks on ads in test mode will not show up in your account's reports.\n\n \u003caside\u003eMediated ads do \u003cem\u003eNOT\u003c/em\u003e render a **Test mode** label. See the section\n below for details.\u003c/aside\u003e\n\nTesting with mediation\n\nGoogle's demo ad units only show Google ads. To test your mediation\nconfiguration, you must use the [enable test devices](#enable_test_devices)\napproach.\n\nMediated ads do *not* render a **Test mode** label. You are responsible for\nensuring that test mode is enabled for each of your mediation networks so that\nthese networks don't flag your account for invalid activity. See each network's\nrespective [mediation guide](/admob/ios/mediation) for\nmore information.\n\nIf you aren't sure whether a mediation ad network adapter provides a test mode,\nit is safest to avoid clicking on ads from that network during development. You\ncan use the\n[`adNetworkClassName`](/admob/ios/api/reference/Classes/GADBannerView#adnetworkclassname)\nproperty on any of the ad formats to figure out which ad network served the\ncurrent ad."]]