获取设备信息(如产品,型号),亚行命令 [英] Get device information (such as product, model) from adb command

查看:250
本文介绍了获取设备信息(如产品,型号),亚行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要实现这一目标的一种方法如下:

One way to achieve this is as follows:

adb devices -l

输出示例:

example output:

123abc12               device product:<id> model:<id> device:<id>
456abc45               device product:<id> model:<id> device:<id>

不过这个列表的所有设备连接,但我想要得到的信息,特定的设备。
我想大概只有123abc12的信息。输出应该是:

But this list's out all devices connected, but I want to get the information for a specific device.
I want information only about "123abc12". The output should be:

123abc12               device product:<id> model:<id> device:<id>

第二装置不应该显示。
我的设备名称即123abc12,它可以用来获得需要的信息,但我不知道怎么办。
谢谢你。

The second device should not be shown.
I have the device name i.e 123abc12, and it can be used to get the required information, but I don't know how.
Thanks.

推荐答案

要做到这一点是正确的方法:

The correct way to do it would be:

adb -s 123abc12 shell getprop

这将给你所有可用的属性及其值的列表。一旦你知道你想要的属性,你可以给该名作为参数,以 getprop 来直接访问它的价值,像这样的:

Which will give you a list of all available properties and their values. Once you know which property you want, you can give the name as an argument to getprop to access its value directly, like this:

adb -s 123abc12 shell getprop ro.product.model

在细节 ADB设备-l 包括以下三个属性: ro.product.name ro.product.model ro.product.device

The details in adb devices -l consist of the following three properties: ro.product.name, ro.product.model and ro.product.device.

请注意,亚行的shell结束与行\ r \ñ,这取决于你的平台上可能会或可能不会使它更难以访问的确切值(例如,而不是的Nexus 7 你可能会得到的Nexus 7 \ r )。

Note that ADB shell ends lines with \r\n, which depending on your platform might or might not make it more difficult to access the exact value (e.g. instead of Nexus 7 you might get Nexus 7\r).

这篇关于获取设备信息(如产品,型号),亚行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆