Connecting to Xiaomi 2 S debugging in Eclipse under Ubuntu12.04

Source: Internet
Author: User
Preface in the first week of my career, I felt the gap between my school and society. I had a small partner who worked almost together in the school, in society, especially big companies, there are basically various great gods and technical experts, and they are still working very hard. I thought I was very diligent before, but in the society, I found that this is only the average level of survival, maybe it is still dependent on the next. In fact, I am glad that at least I have changed the technical direction when I first entered the society, and I have entered a more popular field. There are various great gods around me, I can only work harder and learn more. My friends once said a word & ldquo

Preface

In the first week of my first career, I felt the gap between my school and society. I had a small partner who worked very well in the school, in society, especially big companies, there are basically various great gods and technical experts, and they are still working very hard. I thought I was very diligent before, but in the society, I found that this is only the average level of survival, maybe it is still dependent on the next. In fact, I am glad that at least I have changed the technical direction when I first entered the society, and I have entered a more popular field. There are various great gods around me, I can only work harder and learn more. My friends said, "persistence is victory." I am going to continue.

Previously, emulator was used in Eclipse to install and test apps. It was really slow, and it was difficult to distinguish touch and click. Last night, I finally made up my mind to start my own Xiaomi, direct real machine testing (of course, the company also sent a cloud phone, but want to use its own)

Obtain idVendor

After connecting the usb to Xiaomi 2 seconds, run the following command on the terminal:

Remove the Xiaomi 2 s and execute lsusb as follows:

The two figures show that Bus 002 Device 013: ID 05c6: 9031 Qualcomm, Inc. it is a Xiaomi device (the usb device missing in the second figure), and the unique identifier of Xiaomi 2 S is: 05c6

Add configuration file

The absolute path to add the configuration file is/etc/udev/rules. d/51-Android.rules. There are many different tutorials here, which refer to the official android website.

Add the following content:

# XIAOMI2 device
SUBSYSTEM = "usb", SYSFS {idVendor} = "05c6", MODE = "0666"
SUBSYSTEM = "usb", ATTR {idVendor} = "05c6", ATTR {idProduct} = "9301", SYMLINK + = "android_adb"

Modify permissions:

Sudo chmod a + r/etc/udev/rules. d/51-android.rules

Add adb path

This is to run the adb command more conveniently, saving the trouble of running adb in absolute path every time. The installation directory of my adb is: /home/wzy/Downloads/android-sdk-linux/platform-tools ~ /. Add the following command to bashrc:

# Add java and android paths
Export PATH = $ JAVA_HOME/bin: $ PATH:/home/wzy/Downloads/android-sdk-linux/platform-tools
Alias sudo = 'sudo env PATH = $ Path'

The reason for alias for sudo is that permissions need to be raised when the adb service is restarted. When sudo executes commands with administrative permissions, linux resets the PATH environment variable, of course, this is mainly because of system security considerations to prevent users from executing catastrophic programs. Therefore, we need to reset PATH to our own PATH in sudo.

In other words, we need to really understand why we are doing this. Don't just copy it.

Source ~ /. Bashrc

Write idVendor

Write the idVendor of Xiaomi 2 S ~ /. Android/adb_usb.ini (if this file does not exist, you can create one by yourself)

Enable usb debugging for Xiaomi 2 S & restart adb Service

I also checked it by google here. I need to dial the usb debugging for Xiaomi: * #717717 #*#*

Then execute abd kill-server, adb other command reference link: http://developer.android.com/tools/help/adb.html

In the middle, you need to confirm that USB debugging is allowed on Xiaomi 2 S. Here, we chose to keep agreeing when we got it last night, so we won't be able to do it.

Eclipse debugging

You can see my Xiaomi 2 S device in the DDMS window of Eclipse. During Run, configure the deployments and select Traget.

View devices:

Select target:

Postscript

After reading zhihu, I saw a question like this: "If you have the opportunity to meet you who just graduated from the workplace, what would you say to him ?", I think it is very enlightening. It is important to stick to it seriously.

Ubuntu 13.04 millet 2 s connection Eclipse real machine debugging http://www.linuxidc.com/Linux/2013-09/90216.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.