Bishan
Bishan

Reputation: 15702

Can I remove AdMob ads:testDevices

I used below code to test my app on the emulator.

<com.google.ads.AdView android:id="@+id/adView"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       ads:adUnitId="MY_AD_UNIT_ID"
                       ads:adSize="BANNER"
                       ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
                       ads:loadAdOnCreate="true"/>

When I'm ready to publish my app on google play, should I remove the ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" portion in above code or can I keep that portion with rest of code?

Upvotes: 2

Views: 3523

Answers (2)

Gaurav Arora
Gaurav Arora

Reputation: 17264

It won't effect anything. And your app will show ads for all devices except for those listed as test devices.

However, in general its a good practice to turn off ads before deploying your app.

"Remember to turn the testing flag off before deploying your app if you want to receive real ads." , says documentation

Upvotes: 0

Siddharth Lele
Siddharth Lele

Reputation: 27748

If you refer to the Admobs Best Practise Guide, it states this:

Remember to turn the testing flag off before deploying your app if you want to receive real ads.

I suspect the intention behind this is to protect the device ID from falling into wrong hands in case the app was to be reverse engineered. That is of course speculation on my part.

However, I don't see why leaving behind just this TEST_EMULATOR would cause a problem. But feel free to remove that if you so desire.

Alternatively, you can also turn off testing for all devices from your Admobs console -> Manage Settings (for the specific app) -> App settings tab and selecting this option: Disable test mode for all requests.

This will, however, still not deal with hard-coded device ID's in the XML.

Upvotes: 3

Related Questions