ADB 常用测试命令
ADB是什么?
ADB是android debug bridge --> Android 调试桥
adb查看设备
adb devices
adb 重新挂载
adb remount
adb 设备重启
adb reboot
adb 设备关机
adb shell reboot -p
adb 选择设备
adb -s 设备名称
进入shell
adb shell
常用shell命令
列出文件
ls -l
目录切换
cd 目录地址
查看目录
pwd
删除文件
rm -r //表示删除文件夹rm -f表示强制删除
创建文件夹
mkdir + 名字
创建文件
touch +名字
移动文件
mv 目标文件 目的路径
文件查看
cat 文件
设置文件编码
chcp 65001 //设置为utf-8
chcp 936 //设置为GBK
把文件从系统里pull到u盘或者任意已连接的地方
adb pull 内部文件地址 外部目录
把文件push到系统里
adb push 目标文件 内部目录
抓取logcat输出到文件
adb lohcat > log.lognew throwable
获取包名
使用logcat
logcat | grep START
应用安装
adb install apk名字
应用卸载
adb uninstall 包名
启动应用
adb shell am start -n 包名
发送广播
adb shell broad -a action
adb 截图
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png ./
adb 模拟按键
adb shell input keyevent