最近调试android程序
1,lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 007: ID 046d:c05b Logitech, Inc. M-U0004 810-001317 [B110 Optical USB Mouse]Bus 002 Device 012: ID 0bb4:0c03 HTC (High Tech Computer Corp.) Bus 002 Device 005: ID 058f:a001 Alcor Micro Corp.我用的是 GIONEE GN305不知道为啥显示的是HTC。
2,创建 /etc/udev/rules.d/70-android.rules
内容为:
#gnli305
ID 0bb4 : 0c03 Device 012:
| |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c03",MODE="011"4,$ sudo /etc/init.d/udev restart
5,$ sudo ./adb kill-server
6, $ sudo ./adb start-server
7, $ sudo ./adb devices
:)~
当然啦,如果不想每一个设备都添加,有个偷懒的方法,只要在70-android.rules文件中保留一行即可:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
重复2,4,5,6,7步骤,哦啦。