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.
Simple as that with adb
Use
getprop net.hostname
which has an Android unique Id followed by keywordandroid-<64 bit Hexadecimal String>
example:
You would probably want to use ANDROID_ID.
This is how you can query its value via adb shell:
Or by querying the settings content provider:
The Android serial number can be retreived within the device with getprop :
getprop ro.serialno
From Java, you may want to execute it with Runtime.exec()
you should probably use IMEI:
Try this and find the
id
besides Android. The command gives basically all info about the phone.