为什么 Eclipse 和 ADB 无法识别我的 Android 设备?
我的设备是配备 Android 2.1 的阿尔卡特 OneTouch 890。我在 /etc/udev
文件夹的 rules.d
中的 51-android.rules
中进行了配置。
我的操作系统是Ubuntu。
我在我的设备中启用了 USB 调试模式。
HTC 和三星设备正在检测,但不是我的阿尔卡特,
这是我的 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
My device is Alcatel OneTouch 890 with Android 2.1. I configured in 51-android.rules
in rules.d
of /etc/udev
folder.
My operation system is Ubuntu.
I enabled the usb debugging mode in my device.
HTC and Samsung devices are detecting, but not my Alcatel,
Here is my 51-android.rules
file.
#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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
我也有一部阿尔卡特电话,我通过以下方式解决了此问题:
1.
#lsusb
Bus 002 Device 021: ID 18d1:0002 Google Inc. //This is my alcatel电话
2.将以下内容添加到 /etc/udev/rules.d/51-android.rules:
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="0002", MODE="0666"
注意:我注意到预期的“idVendor”,您还需要添加“idProduct”。
3.#sudo service udev restart
4.拔掉手机再重新插上。
5.#adb devices
连接的设备列表
TCL-Martini设备
I also have an Alcatel Phone and I solve this issue by following:
1.
#lsusb
Bus 002 Device 021: ID 18d1:0002 Google Inc. //This is my alcatel phone
2.Add following to /etc/udev/rules.d/51-android.rules:
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="0002", MODE="0666"
Note:I noticed that expected "idVendor", you also need to add "idProduct".
3.#sudo service udev restart
4.Unplug the phone and plug again.
5.#adb devices
List of devices attached
TCL-Martini device
我知道接受的答案适用于OP,但对于将来遇到此问题且上述答案不起作用的人来说,以下内容对我有用。
这个通用的 udev 规则 -
来自这个问题 - ADB 在 ubuntu 12.04 中未检测到设备 samsung i777
帮助我在“BLU Dash Jr”手机上解决了此问题(供应商=展讯)如我的相关问题中所述:
展讯(供应商 ID 1782)连接 adb 时出现问题
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.
This universal udev rule -
from this question - ADB not detecting device samsung i777 in ubuntu 12.04
Helped me solve this problem on a "BLU Dash Jr" phone (vendor = Spreadtrum) as mentioned in my related question here:
Spreadtrum (Vendor ID 1782) Issues Connecting to adb
我使用 ArchLinux 我安装了这个包:
https://aur.archlinux.org/packages.php?ID=51476
它安装了我需要的所有规则
有关 arch 和 android 的更多详细信息:
https://wiki.archlinux.org/index.php/Android
I use ArchLinux I Installed this package:
https://aur.archlinux.org/packages.php?ID=51476
it installed all rules I need
more details on arch and android:
https://wiki.archlinux.org/index.php/Android
在您的设备中,确保您将 USB 接口用作 MTP 或 PTP。有时它默认以大容量存储接口启动,似乎 adb 没有被授予访问该设备的权限。
In your device make sure you are using your usb interface as MTP or PTP. Some times it starts with mass storage interface by default an seems that adb is not granted permission to access the device.
首先,检查您在 udev 规则中使用的引号类型。您可能使用了非 ASCII 双引号。查看
usb
和usb_device
等引号之间的区别。您也可以按照 @JeremyD 的建议,将
sudo
与 ADB 一起使用。这样做会使该文件基本上变得无关紧要。其次,
~/.android/adb_usb.ini
(或者如果您以 root 身份运行,请检查/root/.android
)0x1bbb
到最后;否则:echo 0x1bbb>> adb_usb.ini
adb Kill-server
adb start-server
adb devices
输出希望这会有所帮助。
First, check the kind of quotes you are using in your udev rules. It looks like you might be using non-ASCII double quotes. See the difference between the quotes around
usb
andusb_device
, etc.You can also just use
sudo
with ADB, as suggested by @JeremyD. Doing that makes this file essentially irrelevant.Second,
~/.android/adb_usb.ini
(or if you are running as root, check/root/.android
)0x1bbb
to the end; otherwise do:echo 0x1bbb >> adb_usb.ini
adb kill-server
adb start-server
adb devices
for your deviceHope this helps.
阿尔卡特 OneTouch 891 - Android 2.1
阅读这些有用的提示和其他一些有关设置 Android 设备的帖子,我写下了如何准备设备的分步教程。
编辑 ~/.android/adb_usb.ini 并附加 0x1bbb 行
在底部。
这将列出:
使其正常工作的步骤:
将您自己添加到群组
为您的发行版安装 51-android.rules 包,然后打开文件:
/etc/udev/rules.d/51-android.rules
在名为 OneTouch 或任何您想要的名称的注释部分下附加以下部分:
因此,结果将是:
保存文件!
重新插入设备的 USB 几次,然后重新启动 adb 守护进程:
发行版特定:
Archlinux
$ rc.d 重新启动 adb
ubuntu、redhat、fedora、centos
$ service adb restart
或手动:
将列出您的设备。
最后:
我在 bash 中显示的结果:
如果仍然没有结果:
运行此命令:
$udevadm触发器
然后再次重新插入您的设备。
或者只是重新启动。
证明:
达尔维克:
http://wstaw.org/m/2011/11/13 /plasma-desktopos8794.jpg
文件管理器:
http://wstaw.org/m/2011/11/13 /plasma-desktopgt8794.jpg
Alcatel 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.
Edit the ~/.android/adb_usb.ini and append 0x1bbb line
at the bottom.
This will list:
Steps to make it working:
Add your self to the group
Install a 51-android.rules package for your distro, then open the file:
/etc/udev/rules.d/51-android.rules
Append the following section under a comment section called OneTouch or whatever you want to name it:
So, the result would be:
Save the file!
Replug USB of the device several times, then restart the adb daemon:
Distro specific:
Archlinux
$ rc.d restart adb
ubuntu, redhat, fedora, centos
$ service adb restart
Or manually:
will list your device.
Finally:
My results showing in bash:
If still no results:
run this command:
$ udevadm trigger
then replug your device again.
or simply reboot.
Proof:
Dalvik:
http://wstaw.org/m/2011/11/13/plasma-desktopos8794.jpg
File Manager:
http://wstaw.org/m/2011/11/13/plasma-desktopgt8794.jpg
尝试关闭 eclipse 后杀死并启动 adb 服务器。
因此,请尝试:
它应该可以工作。我多次遇到这个问题,按照我给你的说明进行操作后,它就可以工作了。
希望它有帮助!
编辑:这可能不起作用,因为大多数 Android 开发人员都转向了 Android Studio 和其他模拟器。
Try to kill and start the adb server after closing eclipse.
So try :
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.
看看这个
http://developer.android.com/guide/developing/ device.html#setting-up
奇怪的是阿尔卡特不包括在内
check this out
http://developer.android.com/guide/developing/device.html#setting-up
it is weird that alcatel isn't included
对于那些有兴趣在 CentOS 上找到 adb 识别设备的永久解决方案的人,我找到了一个解决方案。
首先,以 root 身份运行 adb 并不是一个好的解决方案,因为任何用户都可能随时重新启动 adb;甚至IDE自动重启adb,然后adb又瞎了。
我的解决方案是创建一个组“adb”,并将我的用户添加到该组中。
然后在 51-android-rules 中,添加如下所示的 GROUP:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666", GROUP="adb"
重新加载udev 规则。
如果您使用的是 gnome 会话,请重新启动您的会话,因为 gnome 会在您的组上保留缓存...
打开一个新的 xterm,验证您是否属于 adb 组:
$ groups
然后
$ adb devices
应该启动 adb 服务器然后识别您的设备。For those who would be interested to find out a perrenial solution for adb recognizing devices on CentOS, I found a solution.
First, running adb as root is NOT a good solution, because adb may be restarted by any user at any moment ; even IDE auto-restarts adb, and then adb is blind again.
My solution was to create a group "adb", and add my user to this group.
Then in 51-android-rules, add the GROUP like this :
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666", GROUP="adb"
Reload udev rules.
If you are using a gnome session, restart your session because gnome holds a cache upon your groups...
Open a new xterm, verify that you belong to the adb group :
$ groups
Then
$ adb devices
should start adb server then identify your devices.