Using ADB under Linux, unable to find device problems __linux

Source: Internet
Author: User

Connect the Android device under Ubuntu, although you don't have to install the drive like Windows, but you'll encounter an error: Enter the ADB shell, prompt insufficient permissions for device, and enter the ADB devices, The device name is displayed???????? Wait for a lot of question marks.

This is because Ubuntu runs by default as a non-root user. If you want to use the ADB for USB debugging, using the root account to execute the relevant commands can go into the adb shell, but it is too cumbersome.

Another approach is to configure the rules for Udev. The method is as follows:

1, input lsusb, view the device ID number. As my output reads as follows:

Bus 002 Device 008:id 0bb4:0d02 High Tech Computer Corp.
Bus 008 Device 002:id 046d:c52e Logitech, Inc.
Bus 001 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
Bus 002 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
Bus 003 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 005 Device 001:id 1d6b:0001 Linux Foundation 1.1 root Hub
Bus 006 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
Bus 007 Device 001:id 1d6b:0003 Linux Foundation 3.0 root Hub
Bus 008 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
Bus 009 Device 001:id 1d6b:0003 Linux Foundation 3.0 root Hub

One of the bus 002 Device 008:id 0bb4:0d02 High Tech Computer Corp. This line is my HTC phone's USB usage port. Remember these two id:0bb4 and 0d02 in the middle.

2, sudo vi/etc/udev/rules.d/70-android.rules

If you do not have this file, you can create it and then add the following

subsystem== "USB", attrs{idvendor}== "0bb4", attrs{idproduct}== "0d02", mode= "0666"

3, modify the permissions

sudo chmod a+rx/etc/udev/rules.d/70-android.rules

4, restart the Udev service:

sudo service udev restart

5, restart the ADB server.

Re-connect the device, and then execute sudo./adb kill-server

ADB start-server

Then see if the ADB devices has already shown the name of the device properly.


Ps:

The latest modification method, not to see the device ID, directly under the RULES.D to add a file 51-android.rules, the content is:

[plain] view plain copy subsystem== "USB" env{devtype}== "Usb_device", mode= "0666" is currently universal for all Android devices. After saving as the above steps to modify permissions, restart Udev and ADB, and then plug in the phone again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.