android linux 命令记录

1.find查找
busybox find / -size +1000k
   

2.busybox sh  //执行busybox中的shell命令
1. top -m 4 查看占用当前cpu最高的前4个


2.查看应用程序的命令:adb shell procrank
 注:
 VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
 RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存)
 PSS - Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
 USS - Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
 
3.查看单个应用程序内存占用量的命令:adb shell dumpsys meminfo $包名 或者 $进程号
1.启动activity am start -n com.home/com.home.HomeActivity 2.启动服务
  例如:am startservice -n com.gsme/com. (这里-n表示组件)
    或者 am startservice -a com.gsm.GSMService (这里-a表示动作,就是你在Androidmanifest里定义的) 
    
  3. 发送一个广播:
    am broadcast -a <广播动作>
    例如: am broadcast -a com.smz.mybroadcast  
1.zImage带上root头
cd kernel && make bzImage CONFIG_INITRAMFS_SOURCE=../out/target/product/generic/root/ -j 2 && cd - 
2.zImage+root--------->uImage
./mkimage -A arm -O linux -T kernel -C none -a 80800000 -e 80800000 -d arch/arm/boot/zImage uImage


1.命令修改mac地址:
127|root@android:/sys/class/net/eth0 # busybox vi address                      
32:1a:2d:3d:c1:a4

2.android抓网络包
chmod 777 /system/xbin/tcpdump
/system/xbin/tcpdump -s0 -w /eth0.cap &

3.logcat 打印
1>清除缓存打印:logcat -c
2>打印加上时间:logcat -v time
3>log保存到本地文件:adb logcat -v time >D:\1.log
4>android保存log到设备文件,防漏打印:logcat -v time -f /1.log
root@android:/ # logcat -h
unknown option -- hUnrecognized Option
Usage: logcat [options] [filterspecs]
options include:
  -s Set default filter to silent.
                  Like specifying filterspec '*:s'
  -f <filename> Log to file. Default to stdout
  -r [<kbytes>] Rotate log every kbytes. (16 if unspecified). Requires -f
  -n <count> Sets max number of rotated logs to <count>, default 4
  -v <format> Sets the log print format, where <format> is one of:
                  brief process tag thread raw time threadtime long
  -c clear (flush) the entire log and exit
  -d dump the log and then exit (don't block)
  -t <count> print only the most recent <count> lines (implies -d)
  -g get the size of the log's ring buffer and exit
  -b <buffer> Request alternate ring buffer, 'main', 'system', 'radio'
                  or 'events'. Multiple -b parameters are allowed and the
                  results are interleaved. The default is -b main -b system.
  -B output the log in binary
filterspecs are a series of
  <tag>[:priority]
where <tag> is a log component tag (or * for all) and priority is:
  V Verbose
  D Debug
  I Info
  W Warn
  E Error
  F Fatal
  S Silent (supress all output)
'*' means '*:d' and <tag> by itself means <tag>:v
If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.
If no filterspec is found, filter defaults to '*:I'
If not specified with -v, format is set from ANDROID_PRINTF_LOG
or defaults to "brief"

转载于:https://my.oschina.net/blackylin/blog/145775

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值