Search code examples
androidtestingclickadmobads

Why remove AdMob's addTestDevice() in production?


On this page

https://developers.google.com/admob/android/test-ads#add_your_test_device

it says

Note: Be sure to remove the code that sets these test devices before you release your app.

Can anyone explain why? Why can't I leave the line of code that sends my particular device test ads no matter what? Doesn't this help prevent me from breaking AdMob's rules about developers not accidentally giving themselves false impressions or clicks?


Solution

  • If you have the addTestDevice() in production, user wont be able to see real ads, no matter what is the device id passed to the method.

    You should only use this code in testing.