Getting Android Device Identifier From ADB and Android SDK

前端 未结 12 917
一生所求
一生所求 2021-01-30 17:24

I am looking for the easiest way to get a unique android device identifier from both the Android adb and the Android ADK itself.

For example, when i use the adb \'devi

12条回答
  •  醉梦人生
    2021-01-30 17:39

    Android stores all the device related info in one or the other sqlite DB. These databases can be found in /data/data/ folder. To read these databases from adb you will need root permissions.

    The android id is available in /data/data/com.android.providers.settings/databases/settings.db

    So for adb use this command.

    adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select value from secure where name = 'android_id'"
    

    **you must be running adb as root in adb

提交回复
热议问题