Solution for identifying external devices in Ubuntu

Source: Internet
Author: User
First confirm that the mobile phone is connected to the Ubuntu computer, lsusb to view the device records. Www.linuxidc.com @ linuxidc :~ $ LsusbBus007Device009: ID18d1: 4e12Bus007Device001: ID1d6b: 0002LinuxFoundation2. 0roothubBus006Device001: ID1d6b: 0001 Linu

First confirm that the mobile phone is connected to the Ubuntu computer, lsusb to view the device records.

Www.linuxidc.com @ linuxidc :~ $ Lsusb
Bus 007 Device 009: ID 18d1: 4e12
Bus 007 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Bus 006 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 003 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 004 Device 004: ID 093a: 2510 Pixart Imaging, Inc.
Bus 004 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub I am here:

Bus 007 Device 009: ID 18d1: 4e12 and then create a configuration file: 51-Android.rules under/etc/udev/rules. d/

Add the following configuration parameters to the sudo vim/etc/udev/rules. d/50-android.rules file:

SUBSYSTEM = "usb", SYSFS {"High Tech Computer Corp." }== "0bb4", MODE = "0666" Save, Set permissions for the configuration file

Sudo chmod a + rx/etc/udev/rules. d/50-android.rulesRestart

Sudo/etc/init. d/udev restart and restart the adb service. (If NO environment variable is configured, go to the Android SDK tools directory and run sudo. /adb kill-server. /adb devices)

Sudo adb kill-server
Supplement sudo adb devices
SYSFS parameters:

SYSFS {"idVendor"} = "xxx" for the SYSFS parameter in the Linux ADB driver configuration file, it is the device manufacturer. Because it was a mobile phone made by HTC for Google, "High Tech Computer Corp." was first written on the official website .". But now, a group of mobile phone manufacturers, such as Moto, Sony Ericsson, and Samsung, have joined more than HTC. What should I do if the device model is not 0bb4?

When reading the sdk help documentation, I found that the sdk has provided instructions:
(For details, see docs/guide/developing/device.html)

If you're developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. each device manufacturer uses a different vendor ID. the example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID ). in order to support more devices, you will need additional lines of the same format that provide a different value for the SYSFS {idVendor} property. for other IDs, see the table of USB Vendor IDs, below.

1. Log in as root and create this file:/etc/udev/rules. d/51-android.rules.

For Gusty/hard, edit the file to read: [Note: ubuntu 7.10 and later versions]
SUBSYSTEM = "usb", SYSFS {idVendor} = "0bb4", MODE = "0666 ″

For Dapper, edit the file to read: [Note: ubuntu 6.06 and earlier versions]
SUBSYSTEM = "usb_device", SYSFS {idVendor} = "0bb4", MODE = "0666 ″
2. Now execute:
Chmod a + r/etc/udev/rules. d/51-android.rules

Follow the instructions to change 0bb4 in the 51-android.rules file to the corresponding USB vendor ID.
For example, my mobile phone is motorola and idVender is 22b8.
So this line is

SUBSYSTEM = "usb", SYSFS {idVendor} = "22b8", MODE = "0666", however, you can write multiple lines to use various devices. For example, I wrote all the following:

# ACS 0502
SUBSYSTEM = "usb", SYSFS {idVendor} = "0502", MODE = "0666"
# Dell 413c
SUBSYSTEM = "usb", SYSFS {idVendor} = "413c", MODE = "0666"
# Foxconn 0489
SUBSYSTEM = "usb", SYSFS {idVendor} = "0489", MODE = "0666"
# Garmin-Asus 091E
SUBSYSTEM = "usb", SYSFS {idVendor} = "091e", MODE = "0666"
# HTC 0bb4
SUBSYSTEM = "usb", SYSFS {idVendor} = "0bb4", MODE = "0666"
# Huawei 12d1
SUBSYSTEM = "usb", SYSFS {idVendor} = "12d1", MODE = "0666"
# Kyocera 0482
SUBSYSTEM = "usb", SYSFS {idVendor} = "0482", MODE = "0666"
# LG 1004
SUBSYSTEM = "usb", SYSFS {idVendor} = "1004", MODE = "0666"
# Motorola 22b8
SUBSYSTEM = "usb", SYSFS {idVendor} = "22b8", MODE = "0666"
# Nvidia 0955
SUBSYSTEM = "usb", SYSFS {idVendor} = "0955", MODE = "0666"
# Pantech 10A9
SUBSYSTEM = "usb", SYSFS {idVendor} = "10A9", MODE = "0666"
# Samsung 04e8
SUBSYSTEM = "usb", SYSFS {idVendor} = "04e8", MODE = "0666"
# Sharp 04dd
SUBSYSTEM = "usb", SYSFS {idVendor} = "04dd", MODE = "0666"
# Sony Ericsson 0fce
SUBSYSTEM = "usb", SYSFS {idVendor} = "0fce", MODE = "0666"
# ZTE 19D2
SUBSYSTEM = "usb", SYSFS {idVendor} = "19D2", MODE = "0666", but the above IDs cannot contain all, the usb id of one device is not listed above.
You can use the lsusb command to view your usb id.

Www.linuxidc.com @ linuxidc :~ $ Lsusb
Bus 002 Device 003: ID 413c: 2003 Dell Computer Corp. Keyboard
Bus 002 Device 002: ID 0461: 4d22 Primax Electronics, Ltd
Bus 002 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 18a1: 0002
Bus 001 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub, locate the above ID as 18a1, and add the Device to the file.

SUBSYSTEM = "usb", SYSFS {idVendor} = "18a1", MODE = "0666" Modify/etc/udev/rules. d/51-android.rules does not need to restart the Linux machine. Just plug and unplug the device. Run adb devices again to see that your device is connected.

Www.linuxidc.com @ linuxidc:/opt/android/android-sdk-linux_86/tools $ sudo./adb devices
List of devices attached
0403502001011000 device. Before that, you may see

Www.linuxidc.com @ linuxidc:/opt/android/android-sdk-linux_86/tools $ sudo./adb devices
List of devices attached
???????????? No permissions

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.