Google一番,得知可以通过用root权限启动adb server来解决问题,但是每次用adb不会很麻烦嘛?!
后来发现在SDK的帮助文档里有关于这个问题的说明:
If you’re developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. Each device manufacturer uses a different vendor ID. The example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you will need additional lines of the same format that provide a different value for the SYSFS{idVendor} property. For other IDs, see the table of USB Vendor IDs, below.
- Log in as root and create this file: /etc/udev/rules.d/51-android.rules.
For Gusty/Hardy, edit the file to read:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"For Dapper, edit the file to read:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666" - Now execute:
chmod a+r /etc/udev/rules.d/51-android.rules
只要按照说明,在/etc/udev/rules.d/目录下创建51-android.rules文件,写入自己手机的信息就好了。
什么?你有多个不同品牌的Android手机或平板?每一个都添加自然是可以的,当然也有简便方法啦。
只要在51-android.rules中保留一行
1 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
就好了~
修改以后重新插入你的Android设备,运行adb devices命令看看:
List of devices attached
M1105bfb6840 device
怎么样可以识别了吧~
本文详细介绍了在Ubuntu Linux系统中配置ADB设备连接的步骤,包括为不同的Android设备创建并添加到/etc/udev/rules.d/51-android.rules文件的规则。通过此设置,用户只需在插入设备后执行adb devices命令即可快速识别并连接设备,省去了频繁使用root权限启动adb server的繁琐操作。

1219

被折叠的 条评论
为什么被折叠?



