ADB 常用命令 shell

# 获取连接设备
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}

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值