# 获取连接设备
adb device
# 横向滑动
adb shell input swipe 100 1000 700 1000
# 竖向滑动
adb shell input swipe 500 1200 500 300
# 点击事件
adb shell input tap 500 500
# 获取焦点应用包名和启动Activity
adb shell dumpsys window | findstr mCurrentFocus
adb shell dumpsys window | grep mCurrentFocus
# 启动应用
adb shell am start
# 关闭应用
adb shell am force-stop {packageName}
# 打电话
adb shell am start -a android.intent.action.CALL -d tel:10086
# 亮屏
adb shell input keyevent 26
# home 键
adb shell input keyevent 3
# back 键
adb shell input keyevent 4
# 解锁
adb shell input keyevent 82
# 锁屏
adb shell input keyevent 26
# enter
adb shell input keyevent 66
# 输入文字
adb shell input text 123456
# 录屏
adb shell screenrecord /sdcard/test.mp4
# 截图
adb shell /system/bin/screencap -p /sdcard/screenshot.png
# 屏幕常亮 [true|false|usb|ac|wireless]
adb shell svc power stayon true
# wifi 设置
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb shell svc wifi enable //打开wifi
adb shell svc wifi disable //关闭wifi
# 蓝牙
adb shell service call bluetooth_manager 6 //打开蓝牙
adb shell service call bluetooth_manager 9 //关闭蓝牙
# 关机 重启
# adb reboot //重启
# adb shell reboot //重启
# adb shell reboot -p //关机
# 打开网页
adb shell am start -a android.intent.action.VIEW -d http://google.com
# 卸载应用
adb uninstall com.example.appname
# 定位当前页面位置
adb shell dumpsys activity top
# 获取屏幕分辨率
adb shell wm size
# 设置屏幕分辨率
adb shell wm density 240
# 删除屏幕锁
adb shell rm /data/system/access_control.key
adb shell rm /data/system/password.key
adb shell rm /data/sysem/gesture.key
# 睡眠
sleep 1
# 选择连接哪一部手机
adb -s {序列号}
# 打开应用
adb shell am start {pkg/Activity}
ADB 常用命令 shell
最新推荐文章于 2024-07-11 16:26:04 发布