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!