1.adb devices -----获取已连接设备信息
2.adb install/uninstall “packagename” -----安装卸载包
3.adb pull 手机文件存放路径 电脑文件存放路径 ------拉取手机里的文件到本地电脑上
4.adb push 电脑文件存放路径 手机文件存放路径 ------将本地文件推放到手机里
5.adb logcat|grep 需要过滤的字符串----获取Android设备运行时的log(根据关键字符串进行过滤)
6.adb bugreport>filename.txt-----获取ANR相关log
7.获取Android App运行时的log操作步骤:
- 清除旧日志信息:adb logcat -c
- 开始获取日志:adb logcat -v time>logcat.log(log存放在当前操作的路径)
- 重复出现“crash”的步骤
- 结束日志获取:ctrl + c
- 查看log看是crash还是其他情况
8.查看设备的内存信息:adb shell dumpsys meminfo <package name>
9.查看设备cpu架构:adb shell -> cat proc/cpuinfo|grep Processor
10.adb shell ----进入Android shell,可以执行linux指令
11.pm
adb shell pm list package 列出安装所有应用包名(包括系统的)
adb shell pm list package -3 列出第三方应用包 :-3
adb shell pm dump app 列出应用包的dump详细信息
adb shell pm clear app 清除应用缓存
12.am
adb shell am start -n com.android.camera/.Camera 启动相机
adb shell am start -W com.android.camera/.Camera 等待应用完成启动
adb shell am start -a android.intent.action.VIEW -d http://baidu.com 启动默认浏览器打开一个网页
adb shell am start -a android.intent.action.CALL -d tel:10086 启动拨号器拨打10086
adb shell am monitor 监控crash与ANR
13.坐标操作
adb shell input text test123 键入文本内容
adb shell input tap 362 542 通过坐标点击(x,y)
adb shell input swipe 360 600 100 600 滑动 (x1 ,y1) (x2, y2)
adb shell input keyevent KEYCODE_HOME 点击home键
14.adb shell screencap -p /sdcard/screen.png 截图
15.adb shell screenrecord sdcard/record.mp4 录制 ,ctrl+c结束录制