Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I know that you can find IMEI and MAC address and others by going to Settings -> About phone -> Status. You can also find IMEI by typing *#06# on the keypad. Is there any way to get the ANDROID_ID on the phone itself, as opposed to via this bit of code?

Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID);
share|improve this question
This was cross posted from StackOverflow and ended up closed. –  t0mm13b Dec 18 '12 at 16:05

3 Answers 3

up vote 3 down vote accepted

There is no where in the stock system that provides the ID, however there are apps that will provide it, such as Android System Info.

Some stock ROMS hidden menus also contain this info.

share|improve this answer

You can do this via adb. Does not require root, as far as I know (tested on a Galaxy Nexus running 4.2.1 built from AOSP source):

shell@android:/ $ content query --uri content://settings/secure --projection value --where "name='android_id'"
  settings/secure --projection value --where "name='android_id'"                
  Row: 0 value=<your ID in hexadecimal>
shell@android:/ $
share|improve this answer
If running via a terminal emulator app, root is required. –  Liam W Dec 18 '12 at 15:34
adb has more privileges than the local shell user. With Android 4.x (ICS and up), you can even do a full backup via ADB on an unrooted device -- which the shell user for sure cannot. –  Izzy Dec 18 '12 at 17:47

As eldarerathis variant didn't work out for me, and I didn't want to install an app just for that, I've found a different way. Only possible drawback: It requires root.

adb shell
$ su
# cd /data/data/com.android.providers.settings/databases
# sqlite3 settings.db
sql> select * from secure where name='android_id';

The android_id is found in the third column here (anonymized in the example).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.