如何获取使用adb devices打印的设备名称?

发布于 2024-12-05 02:24:52 字数 283 浏览 5 评论 0原文

当我在

adb devices

控制台中键入内容时,它会打印以下内容:

List of devices attached 
SH16BV815282    device

How do I programmatically get the SH16BV815282, if it possible?

我想通过 android 应用程序在运行时获取该值。这个值实际存储在哪里?

When I type

adb devices

in the console, then it prints this:

List of devices attached 
SH16BV815282    device

How do I programmatically get the SH16BV815282, if it possible at all?

I want to get that value by android application at run time. Where this value is actually stored?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好倦 2024-12-12 02:24:53

我正在使用打击代码来获取设备的名称。

GUIStatics.deviceModel = android.os.Build.MODEL;

I am using blow code for geting name of the device.

GUIStatics.deviceModel = android.os.Build.MODEL;

糖果控 2024-12-12 02:24:52

它是Build.SERIAL。但是,它仅适用于 Android 2.3+。

It's Build.SERIAL. However, it's only available on Android 2.3+.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文