Android miscellaneous-ADB connection to Xiaomi 2 in Ubuntu

Source: Internet
Author: User

I found that ubuntu12.04 could not be connected to Xiaomi development, and ADB devices could not see the device! It took me one morning to complete the operation!

 

The Xiaomi phone uses USB to connect to the Ubuntu 12.04 system. Run the following command:

Longskywang @ bjb0503 :~ $ Lsusb
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 001 device 002: Id 8087: 0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 device 002: Id 8087: 0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 device 003: Id 0a5c: 4500 Broadcom Corp. bcm2046b1 USB 2.0 Hub (part of bcm2046 Bluetooth)
Bus 001 device 004: Id 138a: 0008 validity sensors, Inc. vfs300 fingerprint reader
Bus 002 device 007: Id 1a40: 0101 terminus Technology Inc. 4-port hub
Bus 002 device 008: Id 1a40: 0101 terminus Technology Inc. 4-port hub
Bus 002 device 025: Id 0461: 4d22 primax electronics, Ltd
Bus 002 device 005: Id 0c45: 6481 microdia
Bus 001 device 005: Id 413c: 8161 Dell Computer Corp. Integrated keyboard
Bus 001 device 006: Id 413c: 8162 Dell Computer Corp. Integrated touchpad [synaptics]
Bus 002 device 028: Id 2717: 904e
Bus 001 device 007: Id 413c: 8160 Dell Computer Corp. Wireless 365 Bluetooth

 

Unplug the USB cable from your phone and run the following command:

Longskywang @ bjb0503 :~ $ Lsusb
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 001 device 002: Id 8087: 0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 device 002: Id 8087: 0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 device 003: Id 0a5c: 4500 Broadcom Corp. bcm2046b1 USB 2.0 Hub (part of bcm2046 Bluetooth)
Bus 001 device 004: Id 138a: 0008 validity sensors, Inc. vfs300 fingerprint reader
Bus 002 device 007: Id 1a40: 0101 terminus Technology Inc. 4-port hub
Bus 002 device 008: Id 1a40: 0101 terminus Technology Inc. 4-port hub
Bus 002 device 025: Id 0461: 4d22 primax electronics, Ltd
Bus 002 device 005: Id 0c45: 6481 microdia
Bus 001 device 005: Id 413c: 8161 Dell Computer Corp. Integrated keyboard
Bus 001 device 006: Id 413c: 8162 Dell Computer Corp. Integrated touchpad [synaptics]
Bus 001 device 007: Id 413c: 8160 Dell Computer Corp. Wireless 365 Bluetooth

 

We found that bus 002 device 028: Id 2717: 904e is the phone of Xiaomi.

 

Sudo gedit/etc/udev/rules. d/50-android.rules Add the following text to the open file:

Subsystem = "USB", sysfs {idvendor} = "2717", mode = "0666"
Subsystem = "usb_device", sysfs {idvendor} = "2717", mode = "0666"
Subsystem = "USB", ATTR {idvendor} = "2717", ATTR {idproduct} = "9039", symlink + = "android_adb"

 

Sudo chmod A + Rx/etc/udev/rules. d/50-android.rules

 

 

Note: The names of the 50-android.rules file should be randomly named. You have tried 51-android.rules and 52-android.rules.

Note: "subsystem =" USB ", sysfs {idvendor} =" 2717 ", mode =" 0666 "" is used for system identification after Ubuntu 7.01

"Subsystem =" usb_device ", sysfs {idvendor }==" 2717 ", mode =" 0666 "" is used for system identification before Ubuntu 7.01. It is equivalent to system compatibility.

 

Longskywang @ bjb0503:/etc/udev/rules. d $ sudo service udev restart // or restart udev

Udev start/running, process 7147

Run it in the tools directory of the android SDK (this step is very important and must be sudo, otherwise it will not work)

 

Longskywang @ bjb0503 :~ /Android-SDK/platform-tools $ sudo./ADB kill-Server

Longskywang @ bjb0503 :~ /Android-SDK/platform-tools $ sudo./ADB Devices

* Daemon not running. Starting it now on port 5037 *

* Daemon started successfully *

List of devices attached

At this step, we found that no device exists under the List of devices attached, which means that ADB does not recognize the new USB device.

 

If it is as miserable as me, perform the following operations:

Longskywang @ bjb0503 :~ $ Cd ~
Longskywang @ bjb0503 :~ $ Cd. Android/

Longskywang @ bjb0503 :~ /. Android $ ls
Adbkey adb_usb.ini ~ AVD Debug. keystore repositories. cfg
Adbkey. Pub androidtool. cfg cache default. keyset sites-settings.cfg
Adb_usb.ini androidwin. cfg ddms. cfg modem-nv-ram-5554

Please note that this adb_usb.ini (if not, you can create one by yourself)

Longskywang @ bjb0503 :~ /. Android $ gedit adb_usb.ini

The content is generally as follows:

# Android 3rd party USB vendor ID list -- Do not edit.
# Use 'android update adb' to generate.
#1 USB vendor ID per line.

 

Add a row to it.

# Android 3rd party USB vendor ID list -- Do not edit.
# Use 'android update adb' to generate.
#1 USB vendor ID per line.
Zero X 2717

 

Please note that this 0x2717 is the device number we get

 

Save, disable, and then

Longskywang @ bjb0503 :~ /Android-SDK/platform-tools $ sudo./ADB kill-Server

Longskywang @ bjb0503 :~ /Android-SDK/platform-tools $ sudo./ADB Devices

List of devices attached
9cece53 Device

Note 9cece53 the device line is our recognized Xiaomi phone. Haha

 

Then go to the ddms in eclipse.

 
Related Article

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.