(OK)(OK) Android CLI commands


bridge="br_a_4"
tap="tap_a_4"

tunctl -t ${tap}
ifconfig ${tap} up
brctl addbr ${bridge}
brctl addif ${bridge} ${tap}
ifconfig ${bridge} up

+++++++++++++++++++++++++++++++++++++++++++++++++

bridge="br_a_1"
tap="tap_a_1"

ifconfig ${bridge} down
brctl delif ${bridge} ${tap}
brctl delbr ${bridge}

ifconfig ${tap} down
tunctl -d ${tap}

+++++++++++++++++++++++++++++++++++++++++++++++++

tcpdump -vv -n -i br_a_1

+++++++++++++++++++++++++++++++++++++++++++++++++
Android CLI commands
+++++++++++++++++++++++++++++++++++++++++++++++++

adb connect 192.168.56.3 && adb root
adb pull /data/ztg_tmp.tgz .

/proc/net/fib_trie which seems to have main routing table of kernel inside it

[root@localhost android-x86-6.0-rc1]# gedit ./device/generic/common/init.x86.rc
service dhcpcd_eth0 /system/bin/dhcpcd -ABDKL



logcat > log.txt
dmesg > dmesg.txt
iptables > iptables.txt

// mv /system/bin/dhcpcd /system/bin/dhcpcd.bac

/system/etc/init.sh  -->  do_netconsole() { #... }


ip route show

ip a s
ip rule show
ip route show table all

ip rule del pref 32765

route add -host 112.26.2.1 dev eth0
route add -host 112.26.2.1 gw 112.26.2.254

svc wifi [enable|disable]
svc data [enable|disable]
svc wifi prefer
svc data prefer

svc power stayon [true|false|usb|ac]
//设置屏幕的常亮,true保持常亮,false不保持,usb当插入usb时常亮,ac当插入电源时常亮

vdc volume list
ndc interface list

tcpdump -i any -p -s 0
tcpdump -i any -p -s 0 -w 



// android services
service
    Usage: service [-h|-?]
    service list
    service check SERVICE
    service call SERVICE CODE [i32 INT | s16 STR]
    For example, service check media.player gives Service media.player: found if it's running and Service media.player: not found otherwise.

dumpsys wifi
dumpsys connectivity
dumpsys ethernet

am (Activity Manager)
    usage: am [subcommand] [options]
    start an Activity: am start [-D] [-W]
    -D: enable debugging
    -W: wait for launch to complete
    start a Service: am startservice
    send a broadcast Intent: am broadcast
am startservice com.some.package.name/.YourServiceSubClassName
am force-stop com.some.package.name


pm (Package Manager)
    usage: pm [list|path|install|uninstall]
    pm list packages [-f]
    pm list permission-groups
    pm list permissions [-g] [-f] [-d] [-u] [GROUP]
    pm list instrumentation [-f] [TARGET-PACKAGE]
    pm list features
    pm path PACKAGE
    pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH
    pm uninstall [-k] PACKAGE
    pm enable PACKAGE_OR_COMPONENT
    pm disable PACKAGE_OR_COMPONENT
    pm setInstallLocation [0/auto] [1/internal] [2/external]
    pm set-install-location
    pm get-install-location

input(模拟按键工具)
    usage: input [text|keyevent]
    input text
    input keyevent
    input tap
    input swipe

ime(输入法管理)
    usage: ime list [-a] [-s]
    ime enable ID
    ime disable ID
    ime set ID

getprop
setprop
watchprops

printenv

mount -t vfat /dev/block/mmcblk0p1 /sdcard
mount -o rw,remount -t yaffs /dev/block/mtdblock0 /system

// native services
start {service_name}
stop {service_name}
start和stop命令,用于开始和停止init进程中的service
解决Android系统的daemon被kill之后重新启动的问题

dumpstate | less
    用于将系统设备的状态导出

dumpsys | less
    用于查看应用的状态

procrank | less
    用于抓取Android进程的内存使用信息

iftop
    实时流量监控工具

vmstat
    Report virtual memory statistics




+++++++++++++++++++++++++++++++++++++++++++++++++
Android 6.0 release (Marshmallow).
Android 5.0 release (Lollipop).
Android 4.4 release (KitKat).
Android 4.3 release (Jelly Bean).
Android 4.0 release (Ice Cream Sandwich).
Android 3.2 release (Honeycomb).
Android 2.3 release (Gingerbread).
Android 2.2 release (Froyo).
Android 2.1 release (Eclair).
Android 1.6 release (Donut).
Android 1.5 release (Cupcake).
+++++++++++++++++++++++++++++++++++++++++++++++++
ifconfig tap_d_1 promisc up
ifconfig tap_d_2 promisc up
ifconfig tap_d_3 promisc up
ifconfig tap_d_4 promisc up
ifconfig tap_d_5 promisc up
ifconfig tap_d_6 promisc up
ifconfig tap_d_7 promisc up
ifconfig tap_d_8 promisc up
ifconfig tap_d_9 promisc up
ifconfig tap_d_10 promisc up
ifconfig tap_d_11 promisc up
ifconfig tap_d_12 promisc up
ifconfig tap_d_13 promisc up
ifconfig tap_d_14 promisc up
ifconfig tap_d_15 promisc up
ifconfig tap_d_16 promisc up
ifconfig tap_d_17 promisc up
ifconfig tap_d_18 promisc up
ifconfig tap_d_19 promisc up
ifconfig tap_d_20 promisc up
ifconfig tap_d_21 promisc up
ifconfig tap_d_22 promisc up
ifconfig tap_d_23 promisc up
ifconfig tap_d_24 promisc up
ifconfig tap_d_25 promisc up


posted @ 2016-07-09 16:19  张同光  阅读(128)  评论(0编辑  收藏  举报