2024-10-03 08:00:04

ADB未发现设备

我正在尝试在我全新的Nexus 10上安装一个Android应用程序。我有一个。apk文件。我下载了Android SDK,安装了“Android SDK Tools”,“Android SDK Platform-tools”和谷歌USB Driver。我已经在我的Nexus 10上检查了“未知来源”的设置。

当我从命令终端运行“adb devices”时,它不会列出任何设备。我试图遵循这个建议,因为它与我之前在Stack Overflow上找到的建议完全相同。在执行这些步骤之后,“adb devices”仍然返回一个空列表,更糟糕的是,当我将Nexus 10连接到我的PC时,Windows不会显示设备内的任何文件夹。

我已经取消了该链接中的步骤,以及迄今为止我所做的所有其他操作,还从设备管理器中卸载了我的Nexus 10并重新安装了它,但我仍然没有在设备中看到任何文件夹。

为了让我的设备显示在ADB设备中,我是否遗漏了什么?

我怎么做才能让Windows看到设备内的文件夹?


当前回答

如果你为Nexus启用了开发者选项和USB调试,win-usb应该可以工作。

你的驱动程序是否正确的一个标志是它在设备管理器中的名称中是否包含ADB。

对于我的Galaxy系列,我安装了一个驱动程序,但不是ADB驱动程序。

对于许多非nexus安卓系统,win-usb驱动程序将无法工作。相反,您需要安装一个OEM驱动程序:https://developer.android.com/studio/run/oem-usb.html

这最终让我得到了一个ADB兼容的驱动程序,在切换到PTP后,ADB终于能够找到我的设备。

其他回答

您必须从SDK管理器下载驱动程序(额外→谷歌USB驱动程序)

然后你必须在Windows中安装USB驱动程序(对我来说在Windows 8.1中是有效的):

(从http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver:复制粘贴)

Connect your Android-powered device to your computer's USB port. Right-click on "Computer" from your desktop or Windows Explorer, and select "Manage". Select "Devices" in the left pane. Locate and expand "Other device" in the right pane. Right-click the device name (such as Nexus S) and select "Update Driver Software." This will launch the "Hardware Update Wizard". Select "Browse my computer for driver software" and click "Next." Click "Browse" and locate the USB driver folder. (The Google USB Driver is located in <sdk>\extras\google\usb_driver\.) Click "Next" to install the driver.

问题:设备没有出现在vscode和ABD接口-没有发现驱动程序

解决方案:

Enable USB debugging in mobile. Connect your mobile and laptop using USB cable go to https://developer.android.com/studio/run/win-usb click on the "Click here to download the Google USB Driver ZIP file (ZIP)" go to device manager -> other devices -> right click on ADB device and click update driver software. Select "Browse my computer for Driver Software" Select "Let me pick from list of Device drivers on my computer" double click "show all devices" Click on "Have Disk" option. Select the driver path android-sdk-windows\extras\google\usb_driver .Select android_winusb.inf file select Android ADB interface -> click next Click Yes to install, close the window upon success. Now you will see the device appearing in VSCODE.

除了常规设置(启用USB调试),我还必须在开发人员选项中选择启用OEM解锁。

这可能会降低设备的安全性,但这是你的设备,你知道你想做什么。

检查后,设备按预期运行,并出现在adb设备列表中。

一旦你完成了这些设置,你可以随时反转。

如果你熟悉Linux,就用Linux代替Windows。在树莓派上,这样做

apt-get install android-tools-adb andoid-tools-fastboot

没有特殊的USB驱动程序需要,它只是工作。Android是基于Linux的,所以你更多的是在原生模式下工作。我在这里看到的许多问题都是Windows的问题。osx在这方面也可能比Windows有优势。Adb和fastboot都有man(手册)页面,可以从Linux中访问。

最初的问题:当手机处于fastboot模式时,我在adb中没有看到任何设备,adb和fastboot似乎是互斥的,你一次只能使用其中一个。USB调试必须打开。

For the Blu Studio 5.5s ADB drivers, you have to go through this hoop. I am certain it is the same with all Blu phones or maybe for all non-Google mfg phones, I am not sure. First of all if you connect the Blu device with USB cable and USB Debuggin off, you will see that Windows 7 loads a generic driver for you to copy on/off files to the phone and SD storage. This will appear when the USB cable is first plugged in and appears as a device icon under Control Panel, Device Manager, Portable Devices, BLU STUDIO 5.5 S (or the device you are working with). Do not bother getting the hardware ID yet - just observe that this happens (which indicates you are good so far and don't have a bad cable or something).

Go to the phone and switch on USB Debugging in the Developer section of your phone. Notice that an additional item appears as an undefined device now in the device manager list, it will have the yellow exclamation mark and it may have the same name of the phone listed as you saw under Portable Devices. Ignore this item for the moment. Now, without doing anything to the phone (it should be already in USB debug mode) go back to the Portable Devices in Device Manager and right-click the BLU STUDIO 5.5 S or whatever phone you are working with that is listed there without the exclamation mark (listed under Portable Devices). Right click on the icon under Portable Devices, in this example the name that appears is BLU STUDIO 5.5 S. On that icon select Properties, Details, and under the pull down, select Hardware IDs and copy down what you see.

对于BLU STUDIO 5.5 S,我得到:

USB\VID_0BB4&PID_0C02&REV_0216&MI_00
USB\VID_0BB4&PID_0C02&MI_00

(注意,如果你不按顺序这样做,HW ID将与手机USB调试关闭时不同。你想复制的值,它改变时,USB调试是ON)

现在按照上面的说明进行操作,当然要定制添加INF文件的行,使用与您自己的手机相关的行,而不是与Nexus 10相关的行。下面是要定制的内容;当你下载SDK时,你应该有一个从ZIP扩展而来的文件结构,如下所示:

\adt-bundle-windows-x86_64-20140321\sdk\extras\google\usb_driver

找到名为android_winusb的文件。usb_driver文件夹中的Inf 复制它并命名为任何名称,比如myname.inf 编辑myname。Inf和添加行如上所述,只修改为您的特定电话。例如,对于BLU STUDIO 5.5 S,我根据提示在2个位置添加了以下2行。

;BLU STUDIO 5.5 S
%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&PID_0C02&REV_0216&MI_00
%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&PID_0C02&MI_00

请注意,您将这些行添加到32位和64位部分中,以与教程中的示例相匹配。

Now go back up to the unknown device that appeared in Device Manager when you switched on device USB debugging and right click on this item (has yellow exclamation mark), right click on it and then select Update Driver Software, and then Browse My Computer, Let Me Pick, click on the Have Disk button and browse to find the myname.inf. Continue to agree to all the prompts warning you it might not be the right driver. As the final step, Windows should have identified the device as Android ADB Interface and once that is done, you should be able to go back, open your CMD window and run the command "adb devices" as instructed in this tutorial and now you should see that the phone is now discovered and communicating.

现在您可以开始使用adb命令了。