Last active
July 28, 2022 12:09
-
-
Save iflove/324b4ef55e9d879c0851efa1b4886d84 to your computer and use it in GitHub Desktop.
安卓shell命令
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
安卓shell命令记录 |
安卓常用shell命令
dumpsys meminfo # 查询应用的内存信息
dumpsys activity processes # 查询应用的adj级别 oom: max=16 cur=
cat /proc/[PID]/oom_adj # 命令会直接显示出对应进程号的adj值
adb reboot recovery # 进入recovery模式
adb reboot loader # 进入recovery模式
/sys/class/backlight/backlight # 显示屏亮度值文件
cat /proc/sys/kernel/threads-max # 最大线程
dd if=/dev/zero of=/sdcard/iotest bs=1024000000 count=100 # Linux dd 命令用于读取、转换并输出数据。
cat /proc/meminfo # 实时获取系统内存使用情况(Linux)
dumpsys meminfo # dumpsys 是一种在 Android 设备上运行的工具,可提供有关系统服务的信息。参考链接:https://developer.android.com/studio/command-line/dumpsys?hl=zh-cn
ulimit -a # 用户限制-限制系统范围资源的使用。参考链接:https://ss64.com/bash/ulimit.html
ulimit -n # The maximum number of open file descriptors. 安卓系统一般默认1024
ls -l /proc/进程PID/fd/ # 查看进程fd 列表
sysctl -a # 系统级限制:
lsof -p [pid] # 查看进程使用打开文件列表
cat /proc/sys/fs/file-max # 系统级限制:
ps # Linux中的ps命令是Process Status的缩写。ps命令用来列出系统中当前运行的那些进程。
pstree # 树形显示进程
am start -n com.xxa.app/.MainActivity -es website xxb.com # am 启动activity
busybox watch -n 2 'ls -l /proc/13651/fd/ | wc -l' # 监控命令的运行结果
busybox watch -n 1 "getprop | grep sys.usbcamera.num | tee -a /sdcard/1.txt"
am dumpheap pid/pkgName file # 生成heap文件
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Systrace 命令行工具
systrace -l
//列出可监控的模块类别D:\workspace\sdk\platform-tools\systrace>python2 systrace.py -t 10 -o mytrace.html -a cn.mashang.vscreen.base