编程程高级软件测试工程师必备:常用adb命令集合

· 查看帮助信息:adb/adb -help

· 查看设备号:adb devices

· 启动adb服务:adb start-server

· 关闭adb服务:adb kill-server

· 从电脑端发送文件到手机端:adb push 电脑手机

· 从手机端发送文件到电脑端:adb pull 手机电脑

· 进入shell 命令行:adb shell

· 安装app:adb install 路径/xx.apk

覆盖安装:adb install -r 路径/xx.apk

· 卸载app:adb uninstall app包名

· 查看⼿机运⾏⽇志 adb logcat

· 输出日志到文件:adb logcat > 路径

· 获取单个app运行日志

unix:adb logcat | grep 包名

windows:adb logcat | findstr 包名

· 获取包名

adb shell dump window windows|grepmFocusedAPP

· 获取启动名

adb shell dump window windows|grepmFocusedAPP

· 获取app包名、启动名

unix:adb shell dumpsys windowwindows | grep mFoc

windows:adb shell dumpsys windowwindows | findstr mFoc

· 获取APP冷启动时间:db shell am start -W 包名/启动名

· 获取系统版本

adb shell getgrop ro.build.version.release


版权声明:本文为BCCJY原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。