1.安装adb
apt-get install android-tools-adb
2.配置
1)运行lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 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 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 005: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth Bus 001 Device 004: ID 13d3:5205 IMC Networks Bus 002 Device 006: ID 0bb4:0cee HTC (High Tech Computer Corp.) Bus 002 Device 003: ID 046d:c05a Logitech, Inc. Optical Mouse M90
找到对应的HTC手机信息
2)在/etc/udev/rules.d目录下新建70-android-usb.rules文件,写入:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0cee", MODE="0666", OWNER="<mason>"
3)重启服务
sudo restart udev
4)查询验证设备:
adb devices
3.使用adb控制手机
1)上传文件到手机
adb push /images/test.jpg /sdcard/
2)下载文件到电脑
adb pull /sdcard/images/test.jpg /tmp
3)进入android的shell环境
ado shell
其他adb的功能大家自己百度去把,over!