1 将测试机和开发机通过usb连接
2 通过命令查看usb连接情况
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 013: ID 12d1:1038 Huawei Technologies Co., Ltd. Ideos (debug mode
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0461:4e04 Primax Electronics, Ltd
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 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
注意红色代码显示现在连接的是华为真机,那么读取ID为:12d1
sudo gedit /etc/udev/rules.d/android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
#Acer 0502
SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666"
#Dell 413c
SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666"
#Foxconn 0489
SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666"
#Garmin-Asus 091E
SUBSYSTEM=="usb", SYSFS{idVendor}=="091e", MODE="0666"
#HTC 0bb4
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
#Huawei 12d1
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
#Kyocera 0482
SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666"
#LG 1004
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
#Motorola 22b8
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
#Nvidia 0955
SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666"
#Pantech 10A9
SUBSYSTEM=="usb", SYSFS{idVendor}=="10A9", MODE="0666"
#Samsung 04e8
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
#Sharp 04dd
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
#Sony Ericsson 0fce
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
#ZTE 19D2
SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"
sudo chmod a+rx /etc/udev/rules.d/android.rules
sudo /etc/init.d/udev restart
sudo adb kill-server
同样在目录sdk/platform-tools 中,输入Shell代码
sudo adb devices
原文地址:http://dengxin919820.blog.51cto.com/4673187/1411231