android 基本文件操作命令
2012-07-08 10:24:13 来源:WEB开发网核心提示:brief — Display priority/tag and PID of originating process (the defaultformat).process — Display PID only.tag — Display the priority/tag only
brief — Display priority/tag and PID of originating process (the defaultformat).
process — Display PID only.
tag — Display the priority/tag only.
thread — Display process:thread and priority/tag only.
raw — Display the raw log message, with no other metadata fields.
time — Display the date, invocation time, priority/tag, and PID of theoriginating process.
long — Display all metadata fields and separate messages with a blanklines.
当启动了logcat ,你可以通过-v 选项来指定输出格式:
[adb] logcat [-v <format>]
下面是用 thread 来产生的日志格式:
adb logcat -v thread
需要注意的是你只能-v 选项来规定输出格式 option.
4~~~~~~~~~~~Logcat命令列表
-b <buffer> 加载一个可使用的日志缓冲区供查看,比如event 和radio . 默认值是main 。具体查看Viewing Alternative Log Buffers.
-c 清楚屏幕上的日志.
-d 输出日志到屏幕上.
-f <filename> 指定输出日志信息的<filename> ,默认是stdout .
-g 输出指定的日志缓冲区,输出后退出.
-n <count> 设置日志的最大数目<count> .,默认值是4,需要和 -r 选项一起使用。
-r <kbytes> 每<kbytes> 时输出日志,默认值为16,需要和-f 选项一起使用.
-s 设置默认的过滤级别为silent.
-v <format> 设置日志输入格式,默认的是brief 格式,要知道更多的支持的格式,参看Controlling Log OutputFormat
adb bugreport -return all information from the device
that should be included in a bug report.
adb shell dmesg 查询内核缓冲区信息
adb shell dumpstate 各类信息,比如进程信息,内存信息,进程是否异常,kernnel的log等
adb shell dumpcrash
adb shell dumpsys 查询所有service的状态
-----------其他 -----------
模拟器使用镜像sdcard
用SDK里的mksdcard工具来创建FAT32磁盘镜像并在模拟器启动时加载它。这样创建镜像:? mksdcard <size> <file>,
比如我要创建一个64M的SD卡模拟文件,文件路径是在D:\workspace\sdcard.img
mksdcard 64000000 D:\workspace\sdcard.img
Emulator –sdcard D:\workspace\sdcard.img
或者在eclipse的run菜单的open run dialog对话框中配置启动参数。
#top
Usage: top [ -m max_procs ] [ -n iterations ] [ -d delay ] [ -ssort_column ] [ -t ] [ -h ]
-m num Maximum number of processes to display.
-n num Updates to show before exiting.
-d num Seconds to wait between updates.
-s col Column to sort by (cpu,vss,rss,thr).
-t Show threads instead of processes.
-h Display this help screen.
********* simple selection********* ********* selection by list*********
-A all processes -C by command name
-N negate selection -G by real group ID (supports names)
-a all w/ tty except session leaders -U by real user ID (supports names)
-d all except session leaders -g by session OR by effective group name
-e all processes -p by process ID
T all processes on thisterminal -s processes in the sessionsgiven
更多精彩
赞助商链接