adb作为移动端测试必回的技能之一,日常工作中频繁使用,今天
对adb常用命令进行总结记录。
// 1.重启adb
adb reboot
// 2. 启用adb服务
adb start-server
// 3.关闭服务
adb kill-server
// 4.连接adb设备
adb connect xxx:9999
// 5.关闭设备连接
adb disconnect xxx:9999
// 6.文件推送到手机
adb push D:\xx.test storage/sdcard
// 7.手机文件推送到电脑
adb pull /sdcard/123.txt C:\Users\Administrator\Desktop
// 8.手机已连接设备
adb devices
//9.安装软件
adb install com.xxs
// 10.卸载
adb uninstall com.xxx
// 11.启动手机页面
//例:启动Android原生设置页
adb shell
am start com.android.settings/com.android.settings.Settings
//12.查看手机品牌
adb shell pm list package
//或
adb shell pm list packages -s
// 13.随机时间500次
adb shell monkey -p com.mumuxi.test -v 500
// 14,输入文字
adb shell input text 'mumuxi://www.mumuxi.cn'
// 15 查看所有存活的进程
adb shell ps
//过滤关键字查看
adb shell ps | findstr xxx
例:adb shell ps | findstr android
// 16 清楚缓存
adb shell pm clear <packege name>
例:adb shell pm clear com.mumuxi.test