Connect Android devices to PCs for application debugging

Source: Internet
Author: User

After connecting the Android device to the computer using a USB cable, you can run the Android Application on the device for debugging.

 

 

 

 

My environment:

Android 2.1 update1, HTC G7 Operating System

The PC operating system is ubuntu9.10.

IDE: eclipse3.5.1 (ADT installed)


1 Device setup and Connection

 

1.1 enable device settings-> ApplicationProgram-> Development, hook up USB debugging, maintain the wake-up status and allow imitation positions.

 

1.2 connect the Android device to the PC using a USB cable, and select the connection type as the disk drive.

 

In this case, the target unknown error will occur when you run the program in eclipse. It doesn't matter. Let's continue.

 

 

2. Add a device name to the system.

 

2.1 create a configuration file with the root permission

 

 

Enter sudo gedit/etc/udev/rules. d/50-android.rules in the terminal

Write the following content

Subsystem = "usb_device", sysfs {idvendor }== "0bb4", mode = "0666"

Note: The sysfs {idvendor} here must be changed based on different devices. Here, "0bb4" is the HTC Code. For other codes, see

 

2.2 Modify permissions

Enter chmod A + R/etc/udev/rules. d/50-android.rules in the terminal to change the permission.

 

3. Restart ADB.

Go to the androidsdk directory and run./ADB kill-server and./ADB start-server on the terminal.

 

4. Set the debug option of the project.

 

Open the Application tab in androidmanifest. xml and set debugable to true.

 

Run the project directly in eclipse.

 

References 1. http://androidboss.com/using-android-debug-bridge-adb-in-linux/

2. Android SDK Doc

 

 

 

 

 

 

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.