How to obtain the android_id of a device? [duplicate] How to obtain the android_id of a device? [duplicate] android android

How to obtain the android_id of a device? [duplicate]


adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "SELECT value FROM secure WHERE name='android_id'"

The android id is changeable with a rooted phone...Insert a android id with:

adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "UPDATE secure SET value='IDHERE' WHERE name='android_id'"


It's all in the Javadoc, as linked to by this question you edited 30 minutes before this one! :)
Is there a unique Android device ID?

The "Secure" part just means that apps can't write to it, only read. I seem to recall that this device ID isn't always present; it's populated by the Market as required, perhaps.