在 Android 设备上,有没有一种方法可以以编程方式获取 ADB 中显示的 USB 序列号?
在 Android 设备上,有没有一种方法可以以编程方式获取 ADB 中显示的 USB 序列号?
Secure.getString(mApp.getContentResolver(), Secure.ANDROID_ID) 与 ADB 中显示的不同。
编辑:注意这个问题的日期。之前就问过有android.os.Build.SERIAL;
On an Android device is there a way to programmatically get the USB serial number as shown in ADB?
Secure.getString(mApp.getContentResolver(), Secure.ANDROID_ID) is different then what is shown in ADB.
EDIT: Note the date of this question. It was asked before there was android.os.Build.SERIAL;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
另一种选择是:
Another option is:
获取序列号的最简单方法是:
该序列号等于:命令提示符下的“adb get-serialno”或“adb devices”(如果仅连接 1 个设备)。
The easiest way to obtain serial number is :
This serial number equals to: "adb get-serialno" or "adb devices" from command prompt (if only 1 device connected).
您在这里有几个选择。如果您想通过命令行获取序列号,您可以运行:
如果您想以某种方式在应用程序中获取此信息,请查看 AdbDevice.java。
使用
UsbDeviceConnection
对象,您可以:You have a few options here. If you wanted to get the serial number via the command line, you could run:
If you wanted to somehow get this information within your app, have a look through AdbDevice.java.
Using a
UsbDeviceConnection
object, you can: