ADB is not detecting my android device on Ubuntu

蹲街弑〆低调 提交于 2020-01-31 03:48:04

问题


Need help, "adb" not detect my phone, I do not know what to do; and this was what I did, if I have a mistake or something tell me please.

  1. I log in as root and create this file.

    /etc/udev/rules.d/51-android.rules
    
  2. These are my rules, for my phone LG L80+Bello D331.

    SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
    
  3. I run this command and reboot.

    chmod a+r /etc/udev/rules.d/51-android.rules
    
  4. Finally, I test my changes, but don't display my devices.

    $ adb devices
    List of devices attached
    

Additional Information

Q: Is USB debugging turned on on the Android? R: Yes.

OS: Ubuntu 15.04 (64 bit)

$ lsusb
Bus 004 Device 003: ID 8086:0189 Intel Corp. 
Bus 004 Device 005: ID 1004:6300 LG Electronics, Inc. <<<
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 138a:0011 Validity Sensors, Inc. VFS5011 Fingerprint Reader
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ ls -l /dev/bus/usb/004/
total 0
crw-rw-r-- 1 root root 189, 384 ago 21 05:21 001
crw-rw-r-- 1 root root 189, 385 ago 21 05:21 002
crw-rw-r-- 1 root root 189, 386 ago 21 05:21 003
crw-rw-rw- 1 root root 189, 388 ago 21 18:15 005

Update 1

51-android.rules file changes:

SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"

Command:

$ lsusb
Bus 004 Device 004: ID 8086:0189 Intel Corp. 
Bus 004 Device 003: ID 1004:6300 LG Electronics, Inc. <<<
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 138a:0011 Validity Sensors, Inc. VFS5011 Fingerprint Reader
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ ls -l /dev/bus/usb/004/
total 0
crw-rw-r-- 1 root root    189, 384 ago 21 11:33 001
crw-rw-r-- 1 root root    189, 385 ago 21 11:33 002
crw-rw-rw- 1 root plugdev 189, 386 ago 21 11:33 003 <<<
crw-rw-r-- 1 root root    189, 387 ago 21 11:33 004

But, "adb" don't detect my device: :(

$ adb devices
List of devices attached

Update 2

Here is the solution

Reference

  • Ubuntu Docs Source,
  • Android Docs Source

回答1:


from lsusb output I see that your device connected to Bus 004 as a device 005

Here it is Bus 004 Device 005: ID 1004:6300 LG Electronics, Inc.

I see that you did not create any group.You need to create a group (if permission denied prepend "sudo" following commands):

1) add plugdev group:

 groupadd plugdev

2) add your username to plugdev group (useradd -G {group-name} username):

 useradd -G plugdev orvi

3) restart udev (you may need to log off and log back in to update user group):

 sudo service udev restart

4) Now reload the rules with the following commands:

 sudo udevadm control --reload-rules
 sudo service udev restart
 sudo udevadm trigger

5) Verify device is now allowing plugdev user group access

ls -l /dev/bus/usb/<bus number from step 4>

It should give something like that:

  crw-rw-rw- 1 root plugdev 189, 329 Jul  3 18:23 074

6) Run adb devices to confirm permissions are correct and enjoy!




回答2:


I know your issue was solved, but for everyone in the future make sure you don't have two versions of adb running. Android Studio comes with adb and I installed adb through yum. The instances were interfering with each other and caused lots of issues including not being able to see my device.




回答3:


My phone thought it was connected to the computer, but the computer wouldn't recognize it. On my phone I tapped the notification for 'USB Debugging Enabled', scrolled to 'USB Debugging', and toggled the setting off and on again. adb then saw my phone.




回答4:


On Ubuntu 16.04, I had to install the latest android sdk, rather than the one that comes with apt-get, and finally I could see the devices from adb.




回答5:


Use apt-get install to install the android-tools-adb package.

This gives you a community-maintained default set of udev rules for all Android devices.

Make sure that you are in the plugdev group. If you see the following error message, adb did not find you in the plugdev group:

error: insufficient permissions for device: udev requires plugdev group membership

Use id to see what groups you are in.

Use sudo usermod -aG plugdev $LOGNAME to add yourself to the plugdev group.

The following example shows how to install the Android adb tools package. apt-get install android-tools-adb

form android developer doc: https://developer.android.com/studio/run/device.html#connect



来源:https://stackoverflow.com/questions/32151114/adb-is-not-detecting-my-android-device-on-ubuntu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!