標籤:tcp 操作 udp 網路流 height strong alt bytes lan
/proc/net/xt_qtaguid/stats 基本覆蓋目前所有機型且統計流量全面
adb shell cat /proc/net/xt_qtaguid/stats | grep (uid#)
如: adb shell cat /proc/net/xt_qtaguid/stats | grep 10127
48 wlan0 0x0 10127 0 316574 2279 472562 3651 316574 2279 0 0 0 0 472562 3651 0 0 0 0
49 wlan0 0x0 10127 1 6172960 4936 415951 5215 6172960 4936 0 0 0 0 415951 5215 0 0 0 0
50 wlan0 0x3792d5b400000000 10127 0 29678 208 32168 296 29678 208 0 0 0 0 32168 296 0 0 0 0
51 wlan0 0x3792d5b400000000 10127 1 226170 222 25745 265 226170 222 0 0 0 0 25745 265 0 0 0 0
56 wlan0 0xfa1dcc4b00000000 10127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
57 wlan0 0xfa1dcc4b00000000 10127 1 3014885 2127 139857 2117 3014885 2127 0 0 0 0 139857 2117 0 0 0 0
其中第6和8列為 rx_bytes(接收資料)和tx_bytes(傳輸資料)包含tcp,udp等所有網路流量傳輸的統計。
具體操作方式:
1、找出pid,然後cat /proc/#PID/status | grep uid,找到對應的uid
2.cat /proc/net/xt_qtaguid/stats | grep 10082
一個UID可能對應多個進程,把資料累加起來就行
網路流量統計using ADB