Http://tianmeng126.blog.163.com/blog/static/10800956820115981114488/
After connecting to the Android phone via USB under untun, use adbdevices
The following figure is displayed:
List of devices attached
???????????? No Permissions
The device name is displayed in ddms as well ????, The process name cannot be displayed, and the log cannot be viewed.
I. Introduction to tools
Android-sdk-linux_x86/tools has a bunch of tools, today to use: androiddebug bridge, In the android development process, this tool is the most used. (ADB, a bit like GDB in GCC)
ADB start-server-in fact it will start
Adbfork-server Server
ADB kill-server-kill
Adbdevices-list all devices
2. Set USB Permissions
Because ubuntu and other systems run as non-root by default, sudo is required for USB debugging.
$ Lsusb
Bus 005 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 004 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 003 device 001: Id 1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 002 device 003: Id 413c: 2106 Dell Computer Corp.
Bus 002 device 002: Id 0461: 4d81 primax electronics, Ltd
Bus 002 device 001: id1d6b: 0001 Linux Foundation 1.1 root Hub
Bus 001 device 010: id0bb4: 0c87 high tech Computer Corp.
Bus 001 device 001: id1d6b: 0002 Linux Foundation 2.0 root Hub
In the list, bus 001 device010: Id 0bb4: 0c87 high tech Computer Corp. this line uses the USB port of the HTC mobile phone. record that the ID is 0bb4 (based on the ID of all HTC ).
$ Sudo Vim/etc/udev/rules. d/70-android.rules
Add the following content:
Subsystem = "USB", attrs {idvendor} = "0bb4", attrs {idproduct} = "0c87", mode = "0666"
The idvendoridproduct indicates the usb id that can be queried using lsusb.
For example, mine is:
Lsusb
Bus001 device 010: Id 0bb4: 0c87 high tech Computer Corp
Id 0bb4 is idvendor, and 0c87 is idproduct.
Run the following command to restart udev:
$ Sudo chmod A + Rx/etc/udev/rules. d/70-android.rules
$ Sudo service udev restart
3. Restart adbserver
(Important) unplug the USB and re-connect it. Then execute:
Sudo./adbkill-Server
./ADB Devices
./ADB root (this step is important)
4. Use USB for debugging
The problem in the Problem description has been resolved.
Select the corresponding devices in ddms and you will see the log ....
5. Knowledge Accumulation
1. gooogle udev
2. Unplug the USB and use the following command to monitor the system information in real time.
Sudo tail-F/var/log/messages
Vi. References
1. http://edu.codepub.com/2010/1229/28405.php
2. http://blog.csdn.net/zhenwenxian/archive/2010/09/23/5901350.aspx