adb server启动和连接
adb start-server
//指定端口
adb -P <port> start-server
adb kill-server
- ADB Client通过命令adb connect ip连接远程的终端
adb connect 127.0.0.1:7555
控制手机
adb reboot
adb install app.apk
adb install -r app.apk
adb uninstall 包名
adb shell input keyevent 3
adb shell input keyevent 4
adb shell input keyevent 26
adb shell input keyevent 82
adb shell input keyevent 223
adb shell input keyevent 224
adb shell input keyevent 67
adb shell input text "text"
adb shell input tap 458 573 根据坐标点击
- 滑动
adb shell input swipe x:屏幕左到右 y:从上到下 左上角为0点-图像坐标系
adb shell input swipe 550 1200 550 375
adb shell input swipe 700 200 100 200
adb shell input swipe 100 200 1000 200
文件处理
adb pull /sdcard/file.log topath/
adb push filename /sdcard/filename
adb shell screencap -p /sdcard/screen.png
adb shell screenrecord --time-limit 10 /sdcard/demo.mp4
adb shell screenrecord --size 1280*720 /sdcard/demo.mp4
adb shell screenrecord --bit-rate 6000000 /sdcard/demo.mp4
其他补充
adb shell svc wifi disable
adb shell svc wifi enable
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
扩展
- svc 命令
- 安卓busybox
- wpa_spplicant