Connect to android mobile development programs using eclipse in linux

Source: Internet
Author: User

Developing android programs is certainly the best if you can use a real machine.
In linux, android phones do not use drivers to connect to linux. Unfortunately, they cannot be identified in eclipse. However, you only need the following sentence to solve the problem.
1. First, we need to use the following command to monitor system information in real time
Sudo tail-f/var/log/messages
2. Connect the mobile phone to the usb interface at this time (the mobile phone needs to switch to the usb debugging mode setting --> Application --> Development --> usb debugging)
Messages will appear

Apr 5 18:24:40 msdx kernel: [10873.569350] usb 2-1.3: new high speed USB device number 12 using ehci_hcd
Apr 5 18:24:41 msdx kernel: [10873.655290] usb 2-1.3: New USB device found, idVendor = 0bb4, idProduct = 0c86
Apr 5 18:24:41 msdx kernel: [10873.655295] usb 2-1.3: New USB device strings: Mfr = 1, Product = 2, SerialNumber = 3
Apr 5 18:24:41 msdx kernel: [10873.655298] usb 2-1.3: Product: Android Phone
Apr 5 18:24:41 msdx kernel: [10873.655300] usb 2-1.3: Manufacturer: HTC
Apr 5 18:24:41 msdx kernel: [10873.655302] usb 2-1.3: SerialNumber: SH1CWV800985
Apr 5 18:24:41 msdx kernel: [10873.656901] scsi12: usb-storage 2-1.3: 1.0
Apr 5 18:24:41 msdx mtp-probe: checking bus 2, device 12: "/sys/devices/pci0000: 00/0000: 00: 1d. 0/usb2/2-1/2-1.3"
Apr 5 18:24:41 msdx mtp-probe: bus: 2, device: 12 was not an MTP device
Apr 5 18:24:42 msdx kernel: [10874.656632] scsi 12: 0: 0: 0: Direct-Access HTC Android Phone 0000 PQ: 0 ANSI: 2
Apr 5 18:24:42 msdx kernel: [10874.656752] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.656914] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.656984] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.657043] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.657255] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.657450] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.657611] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.657676] scsi: killing requests for dead queue
Apr 5 18:24:42 msdx kernel: [10874.658087] sd 12: 0: 0: 0: Attached scsi generic sg2 type 0
Apr 5 18:24:42 msdx kernel: [10874.661002] sd 12: 0: 0: 0: [sdb] Attached SCSI removable disk

Do you see the red font above, that is, the usb debugging device ID identified by udev idVendor = 0bb4, idProduct = 0c86
About idVendor = 0bb4, it seems that most android phones are the same.

3. Configure the udev rule file and adjust the permission of the device file.
Next, we can adjust the properties of our Device File Based on the usb debugging device identification we obtained to help android sdk identify usb debugging devices.
Enter su in the terminal, and then enter the super administrator password to log on as the super administrator.
4. Create the udev rule file: Enter gedit/etc/udev/rules. d/50-android.rules
5. Enter the following content in the Open Text Editor:
SUBSYSTEMS = "usb", ATTRS {idVendor} = "0bb4", SYMLINK + = "android_adb", OWNER = "sunshine"
The OWNER corresponds to your own user. ATTRS {idVendor} corresponds to the information obtained in step 1.
(Please note that our purpose is to ensure that the permission of the owner of the device file for android phone debugging is consistent with the permission of the owner of the enabled adb service so that the usb device can be recognized by the adb service ).

6. Run the following command to make the modified configuration take effect (for Fedora and its derivative versions, see udev man for other Linux versions)
Sudo udevadm control -- reload-rules
7. re-insert USB to generate a new device file
In this case, a connection file android_adb will appear under/dev/, pointing to the device that is your USB-debugged mobile phone device.
It should be enough here.

Forwarded to: http://www.linuxso.com/linuxpeixun/25684.html

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.