无法使用 adb 连接 Android 设备

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

Unable to connect Android device using adb

androidadb

提问by Bowie

I am connecting my Samsung Galaxy Tab to my macbook via USB.

我正在通过 USB 将我的 Samsung Galaxy Tab 连接到我的 macbook。

I used to be able to pulling file from my Galaxy Tab using adb but all of a sudden I can't do so.

我曾经能够使用 adb 从我的 Galaxy Tab 中提取文件,但突然间我不能这样做了。

I can see my device using adb devicesbut when using adb -e shell, it prompt error: device not found

我可以看到我的设备正在使用,adb devices但在使用adb -e shell时提示错误:找不到设备

Device already turned on the USB debug mode.

设备已开启 USB 调试模式。

What's going wrong? Anyone can help?

怎么了?任何人都可以帮忙吗?

P.S. My galaxy Tab was running out of battery before, if it has anything to do with it (?)

PS 我的 Galaxy Tab 之前电池没电了,如果它与它有关(?)

回答by Finding Nemo 2 is happening.

Few things you could try:

您可以尝试的几件事:

  1. On your device go to Settings > Storage > USB Computer Connection > Select Camera(PTP) mode.

  2. If you are using eclipse change the Base local debugger port to something like 8601. Increase the ADB connection time. Also put a check in box that says, Use ABDHOST.

  1. 在您的设备上,转到设置 > 存储 > USB 计算机连接 > 选择相机 (PTP) 模式。

  2. 如果您使用 eclipse,请将 Base 本地调试器端口更改为 8601 之类的内容。增加 ADB 连接时间。还要勾选“使用 ABDHOST”框。

回答by Julian Leon Nogales

I had the same problem, and fixed it: in Manifest.xml had

我遇到了同样的问题,并修复了它:在 Manifest.xml 中有

  android:minSdkVersion="11"
  android:targetSdkVersion="16"

and changed it to

并将其更改为

 android:minSdkVersion="10"
  android:targetSdkVersion="15"

Now I can debug on my Samsung Ace and other devices

现在我可以在我的三星 Ace 和其他设备上调试了

回答by Dave A.

Problem is due to more than one device/emulator connected.

问题是由于连接了多个设备/模拟器。

check adb devicesif it shows more than one device then it might not be able to connect to emulators; run adb usbit will restart other devices, then disconnect/reconncet usb cable, now run adb devicesit should show only one device, now do:

检查adb devices它是否显示多个设备,然后它可能无法连接到模拟器;运行adb usb它将重新启动其他设备,然后断开/重新连接 USB 电缆,现在运行adb devices它应该只显示一个设备,现在执行:

adb backup -apk -noshared -all -f Backup_11_30_2014.ab <------(WORKED FOR ME)

adb backup -apk -noshared -all -f Backup_11_30_2014.ab <------(WORKED FOR ME)

OR

或者

adb backup -apk -shared -all -f C:\Users\NAME\backup.ab <---(THIS ONE HANGS)

adb backup -apk -shared -all -f C:\Users\NAME\backup.ab <---(THIS ONE HANGS)

Tutorialthat I found.

我找到的教程

回答by januprasad

I think you should get those messages only when there are no instances of emulator or device running and talking with adb. Even with the device/emulator connected, chances are that adb is losing connection with them. Usually, I do one of adb reset/Kill-server/start-serverto restore normalcy

我认为只有当没有模拟器或设备运行并与 adb 交谈时,您才应该收到这些消息。即使连接了设备/模拟器,adb 也有可能失去与它们的连接。通常,我会做其中之一adb reset/Kill-server/start-server来恢复正常

回答by Vettel

To solve

解决

error: device not found!: OR adb: unable to connect for backup

错误:找不到设备!:或 adb:无法连接以进行备份

1) enable "DEVELOPER OPTIONS" in device settings by 7x tapping Build No field under "About phone"

1)通过点击“关于手机”下的“构建无”字段 7 次,在设备设置中启用“开发者选项”

2) in the now available "DEVELOPER OPTIONS" - enable "USB debugging"

2)在现在可用的“开发人员选项”中 - 启用“USB调试”

3) go to http://clockworkmod.com/carbon/driversand download drivers for your device, unpack archive and go to "device manager on your operating sustem, where you'll find the (unrecognized or recognized) device name (Nexus 5 in my case)

3) 转到http://clockworkmod.com/carbon/drivers并下载您设备的驱动程序,解压存档并转到“操作系统上的设备管理器”,您将在其中找到(无法识别或已识别的)设备名称(Nexus 5 在我的情况下)

Right click and update drivers.

右键单击并更新驱动程序。

4) Run the ADB tool or the HOLO BACKUP mod of that to backup your device.

4) 运行 ADB 工具或它的 HOLO BACKUP mod 来备份您的设备。

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!