1. adb devices或者lsusb查看usb设备的vid和pid,例如:
adb devices:
ljc@ljc ~ $ adb devices
List of devices attached
J7L9KA95B0246439 device
ljc@ljc ~ $
lsusb:
ljc@ljc ~ $ lsusb
Bus 002 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 002 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 002 Device 013: ID 12d1:2608 Huawei Technologies Co., Ltd.
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ljc@ljc ~ $
2. 找到如下路径的文件:
/etc/udev/rules.d/51-android.rules,将我们需要添加的设备在里面添加进去,如下所示:
# add by ljc
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201d", MODE="0666", OWNER="ljc"
# add by ljc
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="201c", MODE="0666", OWNER="ljc"
# add by ljc
SUBSYSTEM=="usb", ATTR{idVendor}=="1782", ATTR{idProduct}=="4001", MODE="0666", OWNER="ljc"
3. 这样还不够,需要在主目录下将vid(切记要写成16进制)添加到如下目录的文件中(.android目录是隐藏的):
/home/ljc/.android/adb_usb.ini
如下所示:
0x0e8d
0x1782
4. 重启adb
adb kill-server
adb start-server
5.一切OK
阅读(6523) | 评论(0) | 转发(0) |