简体   繁体   English

为什么Eclipse和ADB无法识别我的Android设备?

[英]Why is Eclipse and ADB not recognizing my Android Device?

My device is Alcatel OneTouch 890 with Android 2.1. 我的设备是带有Android 2.1的Alcatel OneTouch 890。 I configured in 51-android.rules in rules.d of /etc/udev folder. 我在/etc/udev文件夹的rules.d中配置了51-android.rules

My operation system is Ubuntu. 我的操作系统是Ubuntu。

I enabled the usb debugging mode in my device. 我在设备中启用了usb调试模式。

HTC and Samsung devices are detecting, but not my Alcatel, HTC和三星设备正在检测,但不是我的阿尔卡特,

Here is my 51-android.rules file. 这是我的51-android.rules文件。

#HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
#samsung 
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb_device", SYSFS{idVendor}==”04e8”,ATTRS{idProduct}=="689e", MODE="0666",OWNER="abcd"
#alcatel
SUBSYSTEM=="usb", SYSFS{idVendor}=="1bbb", MODE="0666"
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="1bbb", MODE="0666"


root@abcd:/home/abcd# lsusb
Bus 005 Device 002: ID 0461:4d15 Primax Electronics, Ltd Dell Optical Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 1bbb:00f2 T & A Mobile Phones  // what is T & A in this line....?
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@abcd:/home/abcd# Android/android-sdk-linux_86/platform-tools/adb devices
List of devices attached 

First, check the kind of quotes you are using in your udev rules. 首先,检查您在udev规则中使用的引号类型。 It looks like you might be using non-ASCII double quotes. 看起来您可能正在使用非ASCII双引号。 See the difference between the quotes around usb and usb_device , etc. 查看usbusb_device等引号之间的区别。

SUBSYSTEM=="usb", SYSFS{idVendor}=="1bbb", MODE="0666"
SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”1bbb”, MODE="0666"

You can also just use sudo with ADB, as suggested by @JeremyD. 根据@JeremyD的建议,你也可以只使用sudo和ADB。 Doing that makes this file essentially irrelevant. 这样做会使这个文件无关紧要。

Second, 第二,

  1. Edit ~/.android/adb_usb.ini (or if you are running as root, check /root/.android ) 编辑~/.android/adb_usb.ini (或者如果以root /root/.android运行,请检查/root/.android
  2. If the file already exists, add 0x1bbb to the end; 如果文件已存在, 0x1bbb在末尾添加0x1bbb ; otherwise do: echo 0x1bbb >> adb_usb.ini 否则: echo 0x1bbb >> adb_usb.ini
  3. adb kill-server
  4. adb start-server
  5. Check output of adb devices for your device 检查adb devicesadb devices输出

Hope this helps. 希望这可以帮助。

Alcatel OneTouch 891 - Android 2.1 阿尔卡特OneTouch 891 - Android 2.1

Reading these helpful tips and some other posts about setting the Android device I wrote down a step by step tutorial how to get the device ready. 阅读这些有用的提示以及有关设置Android设备的其他一些帖子,我一步一步地写下了如何准备设备的教程。

Edit the ~/.android/adb_usb.ini and append 0x1bbb line at the bottom. 编辑〜/ .android / adb_usb.ini并在底部追加0x1bbb行。

This will list: 这将列出:

$ adb devices $ adb devices
List of devices attached 附加设备列表
???????????? ???????????? no permissions 没有权限

Steps to make it working: 使其运作的步骤:
Add your self to the group 将您的自我添加到组中
Install a 51-android.rules package for your distro, then open the file: 为你的发行版安装51-android.rules包,然后打开文件:
/etc/udev/rules.d/51-android.rules /etc/udev/rules.d/51-android.rules

** if it's not there, list the package files and locate this file. **如果不存在,请列出包文件并找到该文件。

Append the following section under a comment section called OneTouch or whatever you want to name it: 在名为OneTouch的评论部分或任何您想要命名的部分下面添加以下部分:

SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”1bbb”, MODE="0666"

So, the result would be: 所以,结果将是:

# Alcatel OneTouch 891
SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”1bbb”, MODE="0666"

Save the file! 保存文件!
Replug USB of the device several times, then restart the adb daemon: 多次重新插入设备的USB,然后重新启动adb守护程序:
Distro specific: 特定发行:

  • Archlinux 的Archlinux

    $ rc.d restart adb $ rc.d重启adb

  • ubuntu, redhat, fedora, centos ubuntu,redhat,fedora,centos

    $ service adb restart $ service adb restart

Or manually: 或手动:

$ adb kill-server
$ adb start-server

$ adb devices

will list your device. 将列出您的设备。

Finally: 最后:

My results showing in bash: 我的结果显示在bash中:

$ adb devices $ adb devices
List of devices attached 附加设备列表
0123456789ABCDEF device 0123456789ABCDEF设备

  • If still no results: run this command: 如果仍然没有结果:运行此命令:

    $ udevadm trigger $ udevadm触发器

then replug your device again. 然后再次重新插入你的设备。 or simply reboot. 或者只是重启。

Proof: 证明:


Dalvik: Dalvik的:
http://wstaw.org/m/2011/11/13/plasma-desktopos8794.jpg http://wstaw.org/m/2011/11/13/plasma-desktopos8794.jpg
File Manager: 文件管理器:
http://wstaw.org/m/2011/11/13/plasma-desktopgt8794.jpg http://wstaw.org/m/2011/11/13/plasma-desktopgt8794.jpg

Try to kill and start the adb server after closing eclipse. 关闭eclipse后尝试杀死并启动adb服务器。

So try : 所以尝试:

  1. close eclipse 近食
  2. go to platform-tools directory 转到platform-tools目录
  3. do : sudo ./adb kill-server 执行:sudo ./adb kill-server
  4. disable the development debugging on your phone 禁用手机上的开发调试
  5. enable it again 再次启用它
  6. do : sudo ./adb start-server 执行:sudo ./adb start-server
  7. do : ./adb devices 执行:./ adb devices

It should work. 它应该工作。 I had this problem several times and by doing this it was working after doing instructions I give you. 我有几次这个问题,这样做是在我给你的指示后工作的。

Hope it is helping! 希望它有所帮助!

EDIT: That might be not working as most of the android developers moved to Android studio and other emulators. 编辑:这可能不起作用,因为大多数Android开发人员转移到Android工作室和其他模拟器。

check this out 看一下这个

http://developer.android.com/guide/developing/device.html#setting-up http://developer.android.com/guide/developing/device.html#setting-up

it is weird that alcatel isn't included 阿尔卡特不包括在内是很奇怪的

I also have an Alcatel Phone and I solve this issue by following: 我也有阿尔卡特手机,我通过以下方式解决了这个问题:

1. #lsusb 1. #lsusb

Bus 002 Device 021: ID 18d1:0002 Google Inc. //This is my alcatel phone 总线002设备021:ID 18d1:0002 Google Inc. //这是我的阿尔卡特手机

2.Add following to /etc/udev/rules.d/51-android.rules: 2.在/etc/udev/rules.d/51-android.rules上添加以下内容:

SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="0002", MODE="0666" SUBSYSTEM ==“usb”,ATTRS {idVendor} ==“18d1”,ATTRS {idProduct} ==“0002”,MODE =“0666”

Note:I noticed that expected "idVendor", you also need to add "idProduct". 注意:我注意到预期的“idVendor”,你还需要添加“idProduct”。

3.#sudo service udev restart 3.#sudo service udev restart

4.Unplug the phone and plug again. 4.拔下手机并重新插上电源。

5.#adb devices 5.#adb设备

List of devices attached 附加设备列表

TCL-Martini device TCL-Martini设备

I know the accepted answer worked for the OP, but for people having this issue in the future where the above answers do not work, the following worked for me. 我知道接受的答案适用于OP,但对于将来遇到此问题的人,上述答案不起作用,以下内容对我有用。

This universal udev rule - 这种普遍的udev规则 -

ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:ff420?:*", MODE="0666"

from this question - ADB not detecting device samsung i777 in ubuntu 12.04 从这个问题 - 亚行未在ubuntu 12.04中检测设备samsung i777

Helped me solve this problem on a "BLU Dash Jr" phone (vendor = Spreadtrum) as mentioned in my related question here: 在我的相关问题中提到的“BLU Dash Jr”手机(厂商=展讯)帮我解决了这个问题:

Spreadtrum (Vendor ID 1782) Issues Connecting to adb 展讯(厂商ID 1782)问题连接到adb

For those who would be interested to find out a perrenial solution for adb recognizing devices on CentOS, I found a solution. 对于那些有兴趣在CentOS上找到adb识别设备的perrenial解决方案的人,我找到了一个解决方案。

First, running adb as root is NOT a good solution, because adb may be restarted by any user at any moment ; 首先,以root身份运行adb不是一个好的解决方案,因为任何用户都可以随时重启adb; even IDE auto-restarts adb, and then adb is blind again. 甚至IDE自动重启adb,然后adb再次失明。

My solution was to create a group "adb", and add my user to this group. 我的解决方案是创建一个组“adb”,并将我的用户添加到该组。 Then in 51-android-rules, add the GROUP like this : 然后在51-android-rules中,像这样添加GROUP:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666", GROUP="adb"

Reload udev rules. 重新加载udev规则。 If you are using a gnome session, restart your session because gnome holds a cache upon your groups... 如果您正在使用gnome会话,请重新启动会话,因为gnome会在您的组中保留缓存...

Open a new xterm, verify that you belong to the adb group : $ groups 打开一个新的xterm,验证您是否属于adb组: $ groups

Then $ adb devices should start adb server then identify your devices. 然后, $ adb devices应启动adb服务器,然后识别您的设备。

In your device make sure you are using your usb interface as MTP or PTP. 在您的设备中,确保使用USB接口作为MTP或PTP。 Some times it starts with mass storage interface by default an seems that adb is not granted permission to access the device. 有时,默认情况下,它从大容量存储接口开始,似乎adb未被授予访问设备的权限。

我使用ArchLinux我安装了这个软件包: https ://aur.archlinux.org/packages.php?ID = 51476它安装了所有规则我需要更多有关arch和android的详细信息: https//wiki.archlinux.org/index。 PHP /安卓

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM