1 .首先是查看手机连接的USB端口信息
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 007: ID 0bb4:0c03 HTC (High Tech Computer Corp.)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 5986:01a6 Acer, Inc Lenovo Integrated Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
2.查找你的手机所连接端口的ID
第三行的HTC,这个是我的测试机,那么读取ID为:0bb4
3. 创建android真机的usb规则
sudo gedit /etc/udev/rules.d/51-android.rules
在文件中添加如下内容:(ID:0bb4)
UBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666
保存并关闭规则配置文件,然后改变配置文件权限。
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
4.重启USB和adb服务
sudo service udev restart
sudo adb kill-server
sudo adb devices
至此,完成真机调试前配置工作