Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Advertising Id using adb?

Currently, the only way I know to get Google Advertising Id (by hand) is to open settings and go to Accounts -> Google -> Ads. It is displayed under "Your advertising id"

However, I'd like to get Google Advertising Id via command line using adb. I want to automate this for testing.

For example, this is how I get android id:

android-sdks/platform-tools/adb shell settings get secure android_id

Is there an equivalent command for retrieving Advertising Id?

Thanks for your help in advance.

like image 567
bumbobway Avatar asked Dec 24 '14 06:12

bumbobway


1 Answers

Is there an equivalent command for retrieving Advertising Id?

There is no equivalent command but it is possible if you use grep. The following command works on rooted devices

adb shell grep adid_key /data/data/com.google.android.gms/shared_prefs/adid_settings.xml
like image 75
Jared Rummler Avatar answered Sep 20 '22 02:09

Jared Rummler