开发者

Why is Eclipse and ADB not recognizing my Android Device?

开发者 https://www.devze.com 2023-04-09 10:45 出处:网络
My device is Alcatel OneTouch 890 with Android 2.1. I configured in 51-android.rules in rules.d of /etc/udev folder.

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 开发者_StackOverflow社区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. It looks like you might be using non-ASCII double quotes. See the difference between the quotes around usb and usb_device, etc.

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. Doing that makes this file essentially irrelevant.

Second,

  1. Edit ~/.android/adb_usb.ini (or if you are running as root, check /root/.android)
  2. If the file already exists, add 0x1bbb to the end; otherwise do: echo 0x1bbb >> adb_usb.ini
  3. adb kill-server
  4. adb start-server
  5. Check output of adb devices for your device

Hope this helps.


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:

$ 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:
/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:

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:
Distro specific:

  • Archlinux

    $ rc.d restart adb

  • ubuntu, redhat, fedora, centos

    $ service adb restart

Or manually:

$ adb kill-server
$ adb start-server

$ adb devices

will list your device.

Finally:

My results showing in bash:

$ adb devices
List of devices attached
0123456789ABCDEF device

  • 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


Try to kill and start the adb server after closing eclipse.

So try :

  1. close eclipse
  2. go to platform-tools directory
  3. do : sudo ./adb kill-server
  4. disable the development debugging on your phone
  5. enable it again
  6. do : sudo ./adb start-server
  7. do : ./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.


check this out

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

it is weird that alcatel isn't included


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.


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


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 -

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

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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号