1

当我在我的 xperia 上调试 Android 中的应用程序时,我在控制台输出窗口中看到类似的内容:

[2012-02-25 22:51:20 - App] Automatic Target Mode: using device '4258393032524D395735'
[2012-02-25 22:51:20 - App] Uploading App.apk onto device '4258393032524D395735'

有人知道“4258393032524D395735”的值来自哪里吗?这个值看起来像设备的一些序列号(但不是ro.serialno),它在出厂重置后仍然存在,这正是我所需要的。ANDROID_IDXperia 恢复出厂设置后的变化。

此值不对应TelephonyManager.getDeviceId()

ro.serialno(来自 SystemProperties)是 Xperia mini pro 上的空字符串。

我还有第二台设备(HTC),这个值来自 ro.serialno。

4

3 回答 3

1

I'm pretty sure it is android.os.Build.SERIAL

http://developer.android.com/reference/android/os/Build.html#SERIAL

于 2012-02-25T22:32:51.660 回答
0

I'm not sure what your exact use case is, but you may not want that identifier. There's an post on the Android Dev Blog that covers this situation (http://android-developers.blogspot.com/2011/03/identifying-app-installations.html) and recommends against it. There are also a couple hundred thousand devices with the same "unique" ID.

There's just too much fragmentation in Android for you to get a simple value, I suggest having a method to determine this value with fallbacks based on platform version, etc.

Why do you need something that persists between device resets?

于 2012-02-25T22:30:49.260 回答
0

当您转到 Settings->About->Status->Serial number 时,它是 android.os.Build.SERIAL,它来自 System / Environment 属性:ro.serialno

还有一个 Secure.Android_ID 和一个 TelephonyManager.getDeviceID()

还有其他的,更多在这里

于 2013-10-14T19:14:24.380 回答