ls
查看文件时间,比如推文件后看是否成功推入
ls -lrt
-l可显示时间,-r反向,-t按时间排序。这样最新的在最下面。
进入指定设备的shell(比如连接了多个设备)查看内存及进程优先级
adb devices
adb -s 设备序列号 shell
查看进程pid,比如包名中含camera
adb shell
ps -A | grep camera
-A表示列出所有进程,grep表示查找包含camera的进程。
查看单个进程pid(比如19999)及优先级
adb shell "ps |grep health"
adb shell cat /proc/19999/oom_adj
查看所有进程优先级
adb shell dumpsys meminfo
查看单个进程内存映射、状态
内存映射比如加载了哪些so文件、dex文件
adb shell
然后获取进程pid,比如camera相关:
ps -A | grep camera
获取内存映射:
cat /proc/[pid]/maps
获取状态:
cat /proc/[pid]/status
查看某一包名进程
adb shell ps | findstr 包名
杀掉某一进程
adb shell am force-stop 包名
查看内存信息
adb shell dumpsys meminfo 包名
查看cpu占用信息
adb shell dumpsys cpuinfo
打印实时日志并筛选
adb shell
logcat *:I | grep key_word
会打印含有key_word的且为info级别以上的日志。一般直接grep即可。