前提: 打开小米手机USB调试功能:
系统设置 -> 开发者选项 -> USB调试(选择运行)
在/etc/udev/rules.d目录下新建文件: 51-android.rules
拨线重接后adb kill-server, adb devices可以看到小米2了
List of devices attached
f9197b9 device
系统设置 -> 开发者选项 -> USB调试(选择运行)
在/etc/udev/rules.d目录下新建文件: 51-android.rules
在文件中添加以下内容:sudo vi /etc/udev/rules.d/51-android.rules
编辑文件:SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666", OWNER="aquila", GROUP="plugdev"
# MTP auto mount/umount ENV{ID_VENDOR_ID}=="2717", ENV{ID_MODEL_ID}=="9039", ACTION=="add", RUN+="/usr/bin/sudo -u aquila /usr/local/sbin/go-mtpfs -allow-other=true /media/mtp" ENV{ID_VENDOR_ID}=="2717", ENV{ID_MODEL_ID}=="9039", ACTION=="remove", RUN+="/bin/umount
/media/mtp"
vi .android/adb_usb.ini 0x2717
sudo restart udev
拨线重接后adb kill-server, adb devices可以看到小米2了
List of devices attached
f9197b9 device