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