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
- SUBSYSTEM = "usb | usb_device", SYSFS {idVendor }== "0bb4", MODE = "0660", GROUP = "plugdev"
- SUBSYSTEM = "usb | usb_device", ATTR {idVendor }== "0bb4", ATTR {idProduct }== "0c02", SYMLINK + = "android_adb"
- 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
- Chmod a + r/etc/udev/rules. d/51-android.rules
- Sudo adb kill-server
- Sudo adb devices
Then we will find that adb can be used.
From http://chroya.iteye.com/blog/727245