ubuntu的android studio调试小米手机的方法

设置ubuntu的方法:

在命令行下,输入:

lsusb

输出为:

Bus 001 Device 004: ID 17ef:6050 Lenovo
Bus 001 Device 003: ID 17ef:1003 Lenovo Integrated Smart Card Reader
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

插上手机后,再次输入

lsusb
输出为:

Bus 001 Device 004: ID 17ef:6050 Lenovo 
Bus 001 Device 003: ID 17ef:1003 Lenovo Integrated Smart Card Reader
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 2717:0310  
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
可见多了一行:

Bus 003 Device 003: ID 2717:0310  
其中ID为2717有用:

在/etc/udev/rules.d/目录下建立50-Android.rules规则文件,内容如下:

SUBSYSTEM=="usb", ATTR{idVendor}=="2717″, MODE="0666″

保存,退出后,在命令行输入:

/etc/init.d/udev restart

以上完成ubuntu侧设置。

//////////////////////////////////////////////////////////////////////////////////////////


在小米手机的设置如下:

(1)设置 -> 关于手机->多次点击 MIUI版本选项,打开开发者模式设置。

(2)设置->其他高级设置->开发者选项->开启开发者选项,USB调试


以上完成小米手机设置。

//////////////////////////////////////////////////////////////////////////////////////////
用usb连线,并打开android studio工程,点击调试,可见 Xiaomi MI 4LTE,可以连接

ubuntu的android studio调试小米手机的方法_第1张图片



你可能感兴趣的:(android)