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 'devices' command, the serial number of my connected device is outputted to the screen. I have yet to identify a method in the Android sdk to get me the same serial number.
I don't care what unique identifier is used, just something that can be easily retrieved from both the adb and android sdk. Rooting a device will not be an option.
There are several ways to know your Android Device ID 2- Another way to find the ID is by going to the Menu >Settings > About Phone > Status. The IMEI / IMSI / MEID should be present in the phone status setting. 3- The ID could also be below or under the battery or on the back or bottom of the device itself.
adb shell dumpsys iphonesybinfo You can check and save the IMEI number of your device by dialing *#06# in your dialer app and taking a screenshot of it.
How to find your device ID. Finding your device ID is straightforward whether you have an Android or an Apple device. For an Android enter “*#*#8255#*#*” into the keypad. As soon as you type the last digit the GTalk service monitor device will pop up where you will be able to see your device ID.
You would probably want to use ANDROID_ID.
This is how you can query its value via adb shell:
settings get secure android_id
Or by querying the settings content provider:
content query --uri content://settings/secure/android_id --projection value
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
Simple as that with adb
adb devices -l
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With