ADB命令清单
1. 功能类 名称 命令...
扫码分享二维码
1. 功能类 名称 命令...
扫码分享二维码
1. 功能类
名称 | 命令 | 备注 |
|---|---|---|
重启 | adb reboot | |
重启手机到recovery刷机模式 | adb reboot recovery | |
重启手机到bootloader界面 | adb reboot bootloader | |
关机 | adb shell reboot -p | |
恢复设备DPI | adb shell wm density reset | |
修改设备DPI | adb shell wm density 320 | 320(自定义dpi) |
查看设备DPI | adb shell wm density | |
恢复设备分辨率 | adb shell wm size reset | |
修改设备分辨率 | adb shell wm size 1080x1920 | 1080x1920(自定义分辨率) |
查看设备分辨率 | adb shell wm size | |
查看设备序列号 | adb get-serialno | |
查看设备详情列表 | adb devices -l | |
查看第三方应用包名 | adb shell pm list packages -3 | |
查看系统应用的所有包名 | adb shell pm list packages -s | |
查看所有应用包名 | adb shell pm list packages | |
查看内存使用情况 | adb shell dumpsys meminfo | |
清除应用数据与缓存,需要指定包 | adb shell pm clear cn.com.test.mobile | cn.com.test.mobile(自定义包名) |
卸载应用,需要指定包 | adb uninstall cn.com.test.mobile | cn.com.test.mobile(自定义包名) |
卸载应用,但保留数据和缓存文件,需要指定包 | adb uninstall -k cn.com.test.mobile | cn.com.test.mobile(自定义包名) |
强制停止应用 | adb shell am force-stop cn.com.test.mobile | cn.com.test.mobile(自定义包名) |
截屏 | adb shell screencap -p /sdcard/01.png | 01.png(自定义截屏名称) |
安装apk | adb install d:/temp/1.apk | d:/temp/1.apk(apk绝对路径) |
设置电量百分比 | adb shell dumpsys battery set level 100 | 100(自定义电量百分比) |
启动应用 | adb shell am start -ncn.com.test.mobile/.ui.SplashActivity | -ncn.com.test.mobile(包名).ui.SplashActivity(需要启动的Activity) |
查看Android 系统版本 | adb shell getprop ro.build.version.release | |
查看占用内存前10的应用 | adb shell top -s 10 | |
查看设备品牌 | adb shell getprop ro.product.brand | |
开启 WiFi | adb shell svc wifi enable | |
关闭 WiFi | adb shell svc wifi disable | |
开启指针显示 | adb shell settings put system pointer_location 1 | |
关闭指针显示 | adb shell settings put system pointer_location 0 | |
模拟点击 | adb shell input tap x坐标 y坐标 | |
OTG黑屏时执行 | adb shell settings put system screen_off_timeout 2147483647 | 每次重启软件执行一次 |
2. 按键类
名称 | 命令 | 备注 |
|---|---|---|
电源键 | adb shell input keyevent 26 | |
菜单键 | adb shell input keyevent 82 | |
HOME 键 | adb shell input keyevent 3 | |
返回键 | adb shell input keyevent 4 | |
增加音量 | adb shell input keyevent 24 | |
降低音量 | adb shell input keyevent 25 | |
静音 | adb shell input keyevent 164 | |
播放/暂停 | adb shell input keyevent 85 | |
停止播放 | adb shell input keyevent 86 | |
播放下一首 | adb shell input keyevent 87 | |
播放上一首 | adb shell input keyevent 88 | |
恢复播放 | adb shell input keyevent 126 | |
暂停播放 | adb shell input keyevent 127 | |
点亮屏幕 | adb shell input keyevent 224 | |
熄灭屏幕 | adb shell input keyevent 223 | |
滑动解锁,向上滑动手势解锁 | adb shell input swipe 300 1000 300 500 | 参数 300 1000 300 500 分别表示起始点x坐标 起始点y坐标 结束点x坐标 结束点y坐标 |
焦点处于某文本框时输入文本 | adb shell input text hello |
Copyright Notice
当前文章由【付涛】本人原创开发与文案内容写作,内容版权归当前平台所有,如需转载,请务必注明来源及链接,谢谢合作!
本文最后更新发布于【2024-05-11】,某些文章具有时效性,若有错误或已失效,请联系客服
争议处理:针对本站内容若有异义,亦可直接与【法律顾问:易兴俊,律师联系电话:13825799821】直接联系沟通