参考:http://wiki.cyanogenmod.com/wiki/Udev
前提是你一经连接过nexus系列的设备,系统有adb,androud SDK等
1.先输入lsusb指令获得HTC手机的Vendor ID 和Product ID
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 003 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 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 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 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 002: ID 046d:c31d Logitech, Inc. Bus 008 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 002 Device 071: ID 0bb4:0cac High Tech Computer Corp
Bus 002 Device 071: ID 0bb4:0cac High Tech Computer Corp.
2.在 /etc/udev/rules.d/51-android.rules 中添加下面一行:
#Incredible SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0cac", MODE="0666", OWNER="<gexueyuan>"
gexueyuan@gexueyuan-1204:~$ sudo restart udev [sudo] password for gexueyuan: udev start/running, process 14042 gexueyuan@gexueyuan-1204:~$ adb kill-server gexueyuan@gexueyuan-1204:~$ adb start-server * daemon not running. starting it now on port 5037 * * daemon started successfully *
gexueyuan@gexueyuan-1204:~$ adb devices List of devices attached HT139TD04221 device
udev书写规则
http://www.reactivated.net/writing_udev_rules.html