Android Development tutorial Ubuntu uses ADB to connect millet 2 steps and adb debugging method _android

Source: Internet
Author: User

Step: Two Steps

One, USB connection:

The steps for using the MTP device in Ubuntu Mount are as follows:

1. Connect the MTP device to the PC

2. If you are using the MTP device for the first time, you can skip this step if you need to install the following software:

Copy Code code as follows:

$ sudo apt-get install MTPFS libfuse-dev Libmad0-dev

3. Mount MTP Equipment

Copy Code code as follows:

$ sudo mtpfs-o allow_other/media/mtp

If you are prompted for a busy device, you can wait a while before mounting.

Second, the ADB debugging:

Copy Code code as follows:

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 that this 50-android.rules file name should be arbitrarily named, tried 51-android.rules, 52-android.rules seems to be all possible.

Note "subsystem==" USB, sysfs{idvendor}== "2717", mode== "0666" is for the system recognition after Ubuntu 7.01.

and "subsystem==" Usb_device, sysfs{idvendor}== "2717", mode== "0666" is for Ubuntu 7.01 before the system identification.

Copy Code code as follows:

ubuntu@ubuntu:/etc/udev/rules.d$ sudo service udev restart//or restart Udev
Udev stop/waiting
Udev start/running, Process 1666

Run in the tools directory of the Android SDK (this step is important and must be sudo, otherwise no effect)

Copy Code code as follows:

ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ sudo./adb kill-server
ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ sudo./adb start-server
* Daemon not running. Starting it now on Port 5037 *
* Daemon started successfully *
ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ ADB devices

By this step, it turns out that no devices appear under the List of devices attached, which means that the ADB does not recognize new USB devices.

Do the following:

Copy Code code as follows:

ubuntu@ubuntu:~$ ls-a//You can find a hidden file with "." Beginning:. Android
ubuntu@ubuntu:~$ CD. Android/
ubuntu@ubuntu:~/.android$ gedit Adb_usb.ini

The contents are generally as follows:

Copy Code code as follows:

# ANDROID 3RD Party USB Vendor ID LIST-does not EDIT.
# Use the ' Android update adb ' to GENERATE.
# 1 USB vendor ID per line.

We add one line to it: 0x2717

Please note that this 0x2717 is the device number we got, how to get the device number

1, USB connection mobile phone, the implementation

Copy Code code as follows:

ubuntu@ubuntu:~$ Lsusb
Bus 001 Device 002:id 8087:0024 Intel Corp. integrated Rate Matching Hub
Bus 002 Device 002:id 8087:0024 Intel Corp. integrated Rate Matching Hub
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 009:id 2717:904e
Bus 002 Device 003:id 046d:c05a Logitech, Inc. optical Mouse M90
Bus 002 Device 004:id 413c:2107 Dell Computer Corp.
Bus 002 Device 006:id 05c6:9039 Qualcomm, Inc.


2, unplug the USB data cable

Copy Code code as follows:

ubuntu@ubuntu:~$ Lsusb
Bus 001 Device 002:id 8087:0024 Intel Corp. integrated Rate Matching Hub
Bus 002 Device 002:id 8087:0024 Intel Corp. integrated Rate Matching Hub
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 002 Device 003:id 046d:c05a Logitech, Inc. optical Mouse M90
Bus 002 Device 004:id 413c:2107 Dell Computer Corp.
Bus 002 Device 006:id 05c6:9039 Qualcomm, Inc.
ubuntu@ubuntu:~$

The line in which you can see the difference:

Copy Code code as follows:

Bus 001 Device 009:id 2717:904e

This is the Millet mobile phone USB related information, 2717 is the equipment number!

Adb_usb.ini file finally becomes:

Copy Code code as follows:

# ANDROID 3RD Party USB Vendor ID LIST-does not EDIT.
# Use the ' Android update adb ' to GENERATE.
# 1 USB vendor ID per line.
0x2717

Save, turn off, and then:

Copy Code code as follows:

ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ sudo./adb kill-server
ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ sudo./adb start-server
* Daemon not running. Starting it now on Port 5037 *
* Daemon started successfully *
ubuntu@ubuntu:~/android/android-sdk-linux/platform-tools$ ADB devices
List of devices attached
434b880a offline

But we found the last offline, don't panic, open the phone screen, you can see an option: Allow USB debugging, select Allow. It's done!! The following figure:

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.