Android USB 调试不起作用,adb 忽略 Nexus 7

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21274930/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:16:01  来源:igfitidea点击:

USB Debugging not working, adb ignores Nexus 7

androideclipsedebuggingnexus-7

提问by Bryan Gentry

For several weeks, I was able to connect my Nexus 7 2 to my computer running Windows 7, and Eclipse would recognize it, allowing me to run apps on it. The device also showed up when I ran the adb devicescommand. Every time I plugged the Nexus 7 into the computer, the tablet asked if I wanted to allow USB debugging at that time. (Oddly, it never asked me whether I wanted to always allow it from that computer, but I didn't care.)

几个星期以来,我能够将我的 Nexus 7 2 连接到我运行 Windows 7 的计算机,Eclipse 会识别它,允许我在其上运行应用程序。当我运行adb devices命令时,该设备也出现了。每次将 Nexus 7 插入计算机时,平板电脑都会询问我是否要允许 USB 调试。(奇怪的是,它从来没有问过我是否一直允许从那台计算机上使用它,但我不在乎。)

I recently updated the tablet to Android 4.4.2. I also updated the Android SDKs through the Android SDK manager. Now, when I plug the tablet in, I do not get prompt about USB debugging on the tablet, and neither Eclipse nor adb can see that it is there.

我最近将平板电脑更新为 Android 4.4.2。我还通过 Android SDK 管理器更新了 Android SDK。现在,当我插入平板电脑时,我没有在平板电脑上收到有关 USB 调试的提示,Eclipse 和 adb 都看不到它在那里。

Here is a list of things I tried to do, gathering ideas from various forums around the web.

这是我尝试做的事情的列表,从网络上的各种论坛收集想法。

  • Re-download the Asus drivers for the Nexus 7 and update the driver. However, Windows does not even recognize this as the right drivers for this device.
  • Turn USB Debugging off and on on the tablet, and also revoke all USB debugging permissions.
  • Change the connection mode from media device to camera
  • Switch the runtime from Dalvik to ART
  • Type adb kill-server followed by adb start-server in the command line
  • Delete eclipse and all the Android SDK and download them all over again
  • 重新下载 Nexus 7 的 Asus 驱动程序并更新驱动程序。但是,Windows 甚至不认为这是该设备的正确驱动程序。
  • 在平板电脑上关闭和打开 USB 调试,并撤销所有 USB 调试权限。
  • 将连接模式从媒体设备更改为相机
  • 将运行时从 Dalvik 切换到 ART
  • 在命令行中键入 adb kill-server 后跟 adb start-server
  • 删除 eclipse 和所有的 Android SDK 并重新下载它们

None of this worked. Any other ideas on what to try?

这些都没有奏效。关于尝试什么的任何其他想法?

回答by Bryan Gentry

It turns out that the Nexus 7 definitely needs the Google USB Driver. Finding, downloading, and installing this driver worked perfectly.

事实证明,Nexus 7 肯定需要 Google USB 驱动程序。查找、下载和安装此驱动程序运行良好。

Because Google's Android OEM drivers pagedoes not include the Nexus 7 in its list of devices that need the Google USB driver, I had been trying the driver from Asus, which did not work. I did not try the Google USB driver because for some reason my SDK manager said it had downloaded the driver, but the driver was not to be found.

由于Google 的 Android OEM 驱动程序页面在其需要 Google USB 驱动程序的设备列表中不包括 Nexus 7,因此我一直在尝试来自 Asus 的驱动程序,但没有成功。我没有尝试谷歌 USB 驱动程序,因为出于某种原因,我的 SDK 经理说它已经下载了驱动程序,但找不到驱动程序。

Finally I found I could download the Google USB driver from this page, which clarifies that all Google Nexus devices need this driver. Now I have successfully re-connected the tablet to ADB.

最后我发现我可以从这个页面下载谷歌 USB 驱动程序,这说明所有谷歌 Nexus 设备都需要这个驱动程序。现在我已成功将平板电脑重新连接到 ADB。

I submitted a documentation bug report to Google herein hopes that the OEM drivers page can be updated to reflect that all Google Nexus devices need the Google USB driver.

在这里向 Google提交了一份文档错误报告,希望可以更新 OEM 驱动程序页面,以反映所有 Google Nexus 设备都需要 Google USB 驱动程序。

回答by Artur Poznański

Nexus 7 tablet with Android 4.4.4. Settings > Storage > USB Computer Condition. Two checkboxes: MTP and PTP. Uncheck both.

搭载 Android 4.4.4 的 Nexus 7 平板电脑。设置 > 存储 > USB 计算机状况。两个复选框:MTP 和 PTP。取消选中两者。

回答by user3512646

With your phone disconnected

手机断开连接

In windows explorer - right click computer, go to manage, in computer management find and uinstall device driver (under Android device)

在windows资源管理器-右键计算机,进入管理,在计算机管理中找到并uinstall设备驱动程序(在Android设备下)

Download new drivers from http://developer.android.com/sdk/win-usb.html#top

http://developer.android.com/sdk/win-usb.html#top下载新驱动程序

Connect the phone, windows will try to install new drivers, install drivers manually with drivers downloaded as above

连接手机,windows会尝试安装新的驱动,手动安装驱动,下载驱动如上

The above worked for me

以上对我有用

回答by android developer

For me, after updating to Android 4.4.2, it was critical that I connected the device as a Camera (PTP) rather than as a Media Device (MTP). Previously, before the update, I was able to connect as a Media Device (MTP).

对我而言,在更新到 Android 4.4.2 后,我将设备作为相机 (PTP) 而不是媒体设备 (MTP) 连接是至关重要的。以前,在更新之前,我能够作为媒体设备 (MTP) 进行连接。

回答by user3661946

The problem is that you have not all needed drivers (PC can recognise your phone like usb device but debugging would not work). I solved this problem in Android 4.4.4 by uncheking all items (MTP, PTP, UMS)from menu: storage->USB computer connections and than tick 'Media device(MTP). Now all works fine.

问题是您没有所有需要的驱动程序(PC 可以像 USB 设备一样识别您的手机,但调试不起作用)。我在 Android 4.4.4 中通过取消选中菜单中的所有项目(MTP、PTP、UMS)解决了这个问题:storage->USB computer connections 然后勾选 'Media device(MTP)。现在一切正常。

回答by VSR

thank you Arthur, I found Nexus 7 tab not working even after unchecking or checking. Problem solved by unchecking USB Debugging (under developer options).. settings>Developer option> USB debugging. then check (put tick the MTP device):.storage->USB computer connections and than tick 'Media device(MTP)

谢谢亚瑟,我发现 Nexus 7 选项卡即使在取消选中或选中后也无法工作。通过取消选中 USB 调试(在开发人员选项下)解决了问题。设置>开发人员选项> USB 调试。然后检查(勾选 MTP 设备):.storage->USB 计算机连接,然后勾选“媒体设备(MTP)”

回答by msysmilu

Complete checklist:

完整的清单:

  1. Enable debuggingonto the device
  2. Select USB Connection as PTP (camera)
  3. Install the driverfrom http://developer.android.com/sdk/win-usb.html
  1. 在设备上启用调试
  2. 选择 USB 连接作为 PTP(相机)
  3. http://developer.android.com/sdk/win-usb.html安装驱动程序

回答by Jimmy Ilenloa

Before you try anything, make sure you update your Build related tools using your Android SDK Manager. Your adb might be outdated.

在尝试任何操作之前,请确保使用 Android SDK 管理器更新与构建相关的工具。您的 adb 可能已过时。