1. 查看手机ID号。
charlesxue@THSHIBA:~/setup/cocos2d-x/cocos2d-x-2.1./projects/simpleGame/proj.android/bin$ lsusb
Bus Device : ID 10f1:1a19 Importek
Bus Device : ID 0bda: Realtek Semiconductor Corp. Digital Media Card Reader
Bus Device : ID 05c6: Qualcomm, Inc.
Bus Device : ID 0bda: Realtek Semiconductor Corp. RTL8187B Wireless Adapter
Bus Device : ID 062a: Creative Labs
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
想知道哪个是手机的usb口,很简单的办法就是插上手机执行一下lusb命令,然后拔掉手机再次执行一下lusb比较一下打印结果。在这里我的手机usb驱动是
Bus Device : ID 05c6: Qualcomm, Inc.
在这一步今天碰到一个比较怪的问题是手机的usb显示如下:
Bus Device : ID :
只显示这些内容。然后执行adb devices 也检测不到任何设备。这时用拨号方法打开usb调试即可解决--在拨号键盘输入*#*#717717#*#*.
2.写驱动配置文件。
创建文件 /etc/udev/rules.d/51-android.rules 并写入
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE=""
更改权限
sudo chmod ax+r /etc/udev/rules.d/-android.rules
3.重启usb设备
sudo /etc/init.d/udev restart
4.重启adb服务。
adb kill-server
adb start-server
5.查看设备是否检测到
adb devices
List of devices attached
unauthorized