How to Find Hashed Device ID for Admob Ads Testing in Android Studio

If you are trying to integrate admob advertisements, then it is wise to test it first. During development, it is recommended that you avoid false ad impressions as well as clicks. For that purpose, it is widely suggested that you just use test advertisements which displays a placeholder instead of a live advertisement. To get such test ads, you need to pass your hashed device ID to to AdRequest.Builder.addTestDevice().

Here is an example of how the code looks like:

AdRequest request = new AdRequest.Builder()

You need to find the unique hashed device id to add it to your code. The simplest way to find it in Android Studio is to look at the logcat in Android Monitor.

Here are the steps:

  • Connect your test device with drivers installed, Developer Options and USB debugging enabled.
  • In the bottom of Android Studio, click on Android Monitor and make sure the tab logcat is active.
  • You will see a lot of messages. Type addTestDevice in the search field to filter the text.
  • You will find your unique hashed device id in the results.

Finding Hashed Device Code

If you cannot find it using the logcat then you can use an app that displays the same device id.

Finding Hashed Code for your Device

Here is the link to the application in Google’s Play Store.

I hope that helps you out in testing your advertisements and monetizing your application.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.