Debugging android programs on a linux real machine

Source: Internet
Author: User

In linux, the simulator can be directly identified, and there is no restriction on the use of adb, but after the mobile phone is plugged into the usb, adb does not recognize it and displays a question mark, which is also true in eclipse.

The solution is as follows:

1. input lsusb in bash. We can see that many of the BUS devices are Linux Foundation 1.1 root hub. This is because the port of the usb device is not plugged in, and another string is displayed when the port of the mobile phone is plugged in, for example, I am a High Tech Computer Corp. write down its id: 0bb4: 0c02

 

2. Create a 51-android.rules file in the/etc/udev/rules. d directory with the following content:

Java code
  1. SUBSYSTEM = "usb | usb_device", SYSFS {idVendor }== "0bb4", MODE = "0660", GROUP = "plugdev"
  2. SUBSYSTEM = "usb | usb_device", ATTR {idVendor }== "0bb4", ATTR {idProduct }== "0c02", SYMLINK + = "android_adb"
  3. SUBSYSTEM = "usb | usb_device", ATTR {idVendor }== "0bb4", ATTR {idProduct }== "0c01", SYMLINK + = "android_fastboot"

Here idVendor is the id recorded in step 1.

 

3. Execute the following command:

Java code
  1. Chmod a + r/etc/udev/rules. d/51-android.rules
  2. Sudo adb kill-server
  3. Sudo adb devices

 

Then we will find that adb can be used.

From http://chroya.iteye.com/blog/727245

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.