1)利用lsusb命令找到手机vender id
(如果没有发现手机render信息,那就另外想方法了,有一台海信的手机是这种情况,我还没搞定它)已经搞定
http://blog.csdn.net/scholar_ii/article/details/9318223
==========================================================================
luogw@luogw-ThinkPad-Edge:/etc/udev/rules.d$ lsusb
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 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 001 Device 014: ID
1782:5d04 Spreadtrum Communications Inc.
Bus 002 Device 003: ID 064e:e203 Suyin Corp. Lenovo Integrated Webcam
==========================================================================
(标红为vender id)
2)添加vender id, android-rules信息;
1.在~的.andorid目录下新建adb_usb.ini 文件:
内容形如:
----------------------------------------------------------------------------------------------------------------------------
#lenove S899t,ID 04cc:2323 ST-Ericsson Ux500 serial debug port
0x04cc
#meizu MX2,Bus 001 Device 012: ID 18d1:4e22 Google Inc. Nexus S (debug)
0x18d1
#lenove A288t,Bus 001 Device 014: ID 1782:5d04 Spreadtrum Communications Inc.
0x1782
2.在/etc/udev/rules.d 新建51-android.rules 文件(这时候你需要sudo,内容添加后需要chmod +x 文件,即给文件添加运行权限)
内容形如:
==========================================================================
#lenove S899t,ID 04cc:2323 ST-Ericsson Ux500 serial debug port
SUBSYSTEM=="usb",SYSFS{"lenove S899t"}=="04cc",MODE="0666"
#meizu MX2,Bus 001 Device 012: ID 18d1:4e22 Google Inc. Nexus S (debug)
SUBSYSTEM=="usb",SYSFS{"meizu MX2"}=="18d1",MODE="0666"
#lenove A288t,Bus 001 Device 014: ID 1782:5d04 Spreadtrum Communications Inc.
SUBSYSTEM=="usb",SYSFS{"lenove A288t"}=="
1782",MODE="0666"
===========================================================================
3)重启相关服务,usb service, adb server;
相关的命令:
sudo service udev restart
sudo
/home/luogw/dev-tool/adt-bundle-linux-x86_64-20130522/sdk/platform-tools/adb kill-server
sudo
/home/luogw/dev-tool/adt-bundle-linux-x86_64-20130522/sdk/platform-tools/adb start-server
(蓝色文本的路径视各人环境有所不同)