首先确认手机连接上电脑,lsusb查看下设备记录。
matthew@matthew-1230-laptop:~$ lsusb
1
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
2
|
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
3
|
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
|
4
|
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
|
5
|
Bus 001 Device 004: ID 192f:0916 Avago Technologies, Pte.
|
6
|
Bus 002 Device 018: ID 2717:9039
|
然后在/etc/udev/rules.d/下创建一个配置文件: 51-android.rules
sudo vim /etc/udev/rules.d/50-android.rules
文件里添加如下配置参数:
SUBSYSTEM=="usb", SYSFS{"idVendor"}=="0bb4", MODE="0666"
保存,给配置文件设置下权限
sudo chmod a+rx /etc/udev/rules.d/50-android.rules
Restart
sudo /etc/init.d/udev restart
最后再重启下adb服务,就可以了(没配置环境变量的请进入Android SDK tools目录执行sudo ./adb kill-server ./adb devices)
sudo adb kill-server sudo adb devices
常用的usb Id:
02
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
|
04
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
|
06
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
|
08
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
|
10
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
|
12
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
|
14
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"
|
16
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
|
18
|
SUBSYSTEM=="usb", SYSFS{idVendor}=="2717", MODE="0666"
|
阅读(4050) | 评论(0) | 转发(0) |