如何通过 adb 获取 Android 设备的供应商 ID?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10086464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get Vendor ID of an Android-powered device via adb?
提问by user1323681
I have a problem with how to get vendor ID and product ID of an Android-powered device.
我对如何获取 Android 设备的供应商 ID 和产品 ID 有疑问。
Are there any commands of adb that can do this?
是否有任何 adb 命令可以执行此操作?
I can get vendor id and product id while device inserted, but after installing windows drivers, I could not tell apart the real vendor id if I insert two devices at on time. So I need to find out the vendor ID via ADB or any other connections between the hardware device and the android device.
我可以在插入设备时获取供应商 ID 和产品 ID,但是在安装 Windows 驱动程序后,如果我同时插入两个设备,我无法区分真正的供应商 ID。所以我需要通过 ADB 或硬件设备和 android 设备之间的任何其他连接找出供应商 ID。
回答by Ajith Memana
If you are running Ubuntu/Linux Just Key in
如果您正在运行 Ubuntu/Linux 只需键入
"lsusb -v "
and press enter. It will bring out details of all USB devices. Check for a field called "idVendor" in the results and find your device. Eg: My Motorola Defy[vendor id = 22b8] gives,
并按回车键。它将显示所有 USB 设备的详细信息。检查结果中名为“idVendor”的字段并找到您的设备。例如:我的摩托罗拉 Defy[vendor id = 22b8] 给出,
" idVendor 0x22b8 Motorola PCS"
“ idVendor 0x22b8 摩托罗拉 PCS”
回答by Edijae Crusar
i don't know whether you got the solution but connecting my phone via USB cable to my computerand typing the below line of code on ubuntu terminal i was able to get Vendor ID
我不知道您是否得到了解决方案,但是通过 USB 电缆将我的手机连接到我的计算机并在 ubuntu 终端上键入以下代码行我能够获得供应商 ID
lsusb
For example, if you had a Nexus One connected you would get:
例如,如果您连接了 Nexus One,您将获得:
Bus 002 Device 004: ID 18d1:4e12
总线 002 设备 004:ID 18d1:4e12
In this case the Vendor Id is “18d1″ and the Product ID is “4e12″. (we are interested in vendor id of course)
在这种情况下,供应商 ID 为“18d1”,产品 ID 为“4e12”。(我们当然对供应商 ID 感兴趣)
回答by CJBS
ADB itself will not help find the Vendor ID of a connected piece of hardware, indeed (for the Google ADB driver) it's necessary to have the Vendor ID set up in advance of it working with ADB.
ADB 本身不会帮助找到连接的硬件的供应商 ID,实际上(对于 Google ADB 驱动程序)有必要在使用 ADB 之前设置供应商 ID。
Fortunately, there's an easy way to find the Vendor ID (and Product ID) of any device connected to a Windows PC. The device doesn't even need drivers for this approach to work:
幸运的是,有一种简单的方法可以找到连接到 Windows PC 的任何设备的供应商 ID(和产品 ID)。该设备甚至不需要驱动程序即可使用此方法:
- Start Device Manager
- In the Hardware tree, right-click the hardware entry for the device for which the Vendor ID is to be determined.
- 启动设备管理器
- 在硬件树中,右键单击要确定其供应商 ID 的设备的硬件条目。
- On the Details tab, set the property drop-down to be "Hardware Ids". The Vendor ID is the 4 character hexadecimal number following the letters
VID_
. In the case below, the Vendor ID is18D1
:
- 在详细信息选项卡上,将属性下拉列表设置为“硬件 ID”。供应商 ID 是字母后面的 4 个字符的十六进制数
VID_
。在以下情况下,供应商 ID 为18D1
:
The PID_
, which follows, is the Product ID. It also has a 4-digit hexadecimal number.
的PID_
,下面,是产品ID。它还有一个 4 位十六进制数。
回答by Vijay
Hope this linkhelp you
希望这个链接对你有帮助
-s serialNumber is the adb command that give you a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").I think this is the adb command that you are looking for.
-s serialNumber 是 adb 命令,它为您提供特定的模拟器/设备实例,由其 adb 分配的序列号(例如“emulator-5556”)引用。我认为这是您正在寻找的 adb 命令。