Google Android USB 驱动程序和 ADB [英] Google Android USB Driver and ADB

查看:82
本文介绍了Google Android USB 驱动程序和 ADB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关以下问题的指导或明确答案.我想使用 Google Android USB 驱动程序并修改 android_winusb.inf 以支持任意数量的 Android 设备.我能够成功添加 HTC Evo 平板电脑,但是当我尝试添加 LG(Optimus)或三星(Indulge、Admire)时,驱动程序似乎安装正常,但 ADB 没有看到.

I am looking for guidance or a definitive answer on the following. I want to use the Google Android USB Driver and modify the android_winusb.inf to support any number of Android devices. I was able to add an HTC Evo tablet successfully, but when I try to add LG (Optimus) or Samsung (Indulge, Admire) the driver seems to install fine, but ADB does not see it.

您可以让 Google Android 驱动程序适用于任何 Android 手机吗?如果是这样……怎么办?

Can you make the Google Android Driver work for any Android phone? If so... how?

我已经尝试了许多 %SingleAdbInterface%%CompositeAdbInterface% 的排列以及供应商和产品 ID 的变化.

I have tried many permutations of %SingleAdbInterface% and %CompositeAdbInterface% with the variations of Vendor and Product ids.

推荐答案

您需要修改 3 件事,以使 Google USB 驱动程序适用于任何 Windows 上的任何 Android 手机:

You need to modify 3 things in order to make Google USB driver work for any android phone on any Windows:

  1. 将您的设备 ID 添加到 android_winusb.inf 文件
  2. 对修改后的驱动程序进行数字签名
  3. 将您设备的供应商 ID 添加到 adb_usb.ini 白名单(不再需要)
  1. Add your device's ID to android_winusb.inf file
  2. Digitally sign the modified driver
  3. Add your device's vendor ID to adb_usb.ini whitelist (no longer required)

以下是详细信息:

1.将您的设备 ID 添加到 android_winusb.inf 文件

1. Add your device's ID to android_winusb.inf file

添加格式为:

;Comment usually the device name
%SingleAdbInterface% = USB_Install, USB; here you put VID and PID
%CompositeAdbInterface% = USB_Install, USB; same as above but add the MI

在我继续之前,VID 是 USB 供应商 ID.

before I go on, VID is the USB Vendor ID.

如何获取 vid 和 pid:它们在您要合并的驱动程序中;但是如果你没有设备的驱动程序,你可以通过打开设备管理器来获取它;然后右键单击设备 - 在新对话框中选择属性,转到详细信息选项卡 > 在属性下拉菜单中选择硬件 ID.例如,您会看到如下内容:

How to get the vid and pid : they are in drivers you are merging; but if you don’t have a driver for the device you can get it by opening device manager; then right-click the device – select properties-in new dialog go to Details tab >in property drop menu select hardware ids. for example you see something like:

USBVID_2207&PID_0000&REV_0222&MI_01
USBVID_2207&PID_0000&MI_01

复合adb设备取这个值,去掉单个adb设备的MI,你得到

take this value for composite adb device and remove MI for single adb device, you get

;MSI WindPad Enjoy 7 plus
%SingleAdbInterface%        = USB_Install, USBVID_2207&PID_0000
%CompositeAdbInterface%     = USB_Install, USBVID_2207&PID_0000&REV_0222&MI_01
;

复制这 2 行两次,一次到 [Google.NTx86] 部分,另一行到 [Google.NTamd64] 部分

copy this 2 line TWICE , once to [Google.NTx86] section and another to [Google.NTamd64] section

为您想要支持的每个设备重复

REPEAT for every device you want to support

现在对 [Strings] 部分进行可选编辑

Now an optional edit for [Strings] Section: edit

[Strings]
ProviderName                = "Google, Inc."
SingleAdbInterface          = "Android ADB Interface"
CompositeAdbInterface       = "Android Composite ADB Interface"
SingleBootLoaderInterface   = "Android Bootloader Interface"
WinUSB_SvcDesc              = "Android USB Driver"
DISK_NAME                   = "Android WinUsb installation disk"
ClassName                   = "Android Device"

致:

[Strings]
ProviderName                = "Google, Inc."
SingleAdbInterface          = "MSI ADB Interface"
CompositeAdbInterface       = "MSI Composite ADB Interface"
SingleBootLoaderInterface   = "MSI Bootloader Interface"
WinUSB_SvcDesc              = "MSI USB Driver"
DISK_NAME                   = "MSI WinUsb installation disk"
ClassName                   = "MSI Tablet"

2.对修改后的驱动程序进行数字签名:

虽然原始的 google usb 驱动程序是由 google 签名的,但修改 android_winusb.inf 将阻止在 windows 8 上安装它并显示错误消息

Although the original google usb driver was signed by google , modifying android_winusb.inf will prevent installing it on windows 8 showning an error message

The hash file is not present in the specified catalog file. The file is likely
corrupt    or the    victim of tampering.

这仅在 Windows 8 中.Windows 7 或更早版本不显示此错误消息.您必须重新生成目录文件(可能使用 Windows SDK)并签名

This is only in Windows 8. Windows 7 or earlier do not show this error message. You have to regenerate catalog file (probably with Windows SDK) and sign

变通方法:内部测试的变通方法是禁用 Windows 签名验证:临时或永久:

Workaround: A workaround for internal tesing is to diable windows signature verification : either temporarily or permanently:

暂时:

转到屏幕左上角或左下角打开超级按钮栏,然后单击设置超级按钮.

Go to left upper or lower corner of screen to open charms bar and click settings charm.

选择更改电脑设置

选择通用

向下滚动,然后点击高级启动"下的立即重启".

Scroll down, and click ‘Restart now’ under ‘Advanced startup’.

点击疑难解答".点击高级选项"单击Windows 启动设置"点击重新启动.

Click ‘Troubleshoot’. Click ‘Advanced Options’ Click ‘Windows Startup Settings’ Click Restart.

运行cmd并输入:

shutdown -o -r -t 0

然后在重新启动后从列表中选择禁用驱动程序签名强制".在重新启动之前安装您的驱动程序.

then after restarting choose ‘Disable driver signature enforcement‘ from the list . install your driver before restarting.

永久:

按窗口+Q

搜索cmd

右键单击cmd

从操作栏中选择以管理员身份运行

choose run as administrator from action bar

输入cmd:

bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
bcdedit -set TESTSIGNING ON

3.将您设备的供应商 ID 添加到 adb_usb.ini 白名单(不再需要):

3. Add your device's vendor ID to adb_usb.ini whitelist (no longer required):

adb 曾经有一个硬编码的受支持供应商 ID 白名单.如果您的设备供应商不在列表中 - adb 会完全忽略它.要让 adb 识别此类设备,用户必须手动将其供应商 ID 添加到 %USERPROFILE%.androidadb_usb.ini - 每行一个 ID.

adb used to have a hard-coded whitelist of supported Vendor IDs. If your device's vendor was not on the list - the adb was ignoring it completely. To make adb recognize such devices users had to manually add their vendor IDs to %USERPROFILE%.androidadb_usb.ini - one ID per line.

在命令行中:

echo 0x2207 >> "%USERPROFILE%.androidadb_usb.ini"

幸运的是,Google 在最近的 adb 版本中删除了 VendorID 过滤.因此不再需要此步骤.

Fortunately, Google has removed the VendorID filtering in more recent adb versions. So this step is no longer required.

最后您可以通过以下方式测试安装:

adb kill-server
adb start-server
adb devices

并在安卓设备的开发者选项中启用调试

and enabling debugging in developer options on android device

这应该重新启动 ADB 服务器并列出设备.如果驱动程序工作正常,则应列出该设备.

This should restart ADB Server and list devices. If driver is working ok, the device should be listed.

这篇关于Google Android USB 驱动程序和 ADB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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