// Copy tcpdump to device
$ adb -d push /path/to/tcpdump /sdcard/tcpdump
// Device shell
$ adb -d shell
// Switch to root
$ su
// Copy tcpdump to /data/local/
# cat /sdcard/tcpdump /data/local/tcpdump
抓包
12345678910111213
/# cd /data/local
/# ./tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
// Options
# "-i any": listen on any network interface
# "-p": disable promiscuous mode (doesn't work anyway)
# "-s 0": capture the entire packet
# "-w": write packets to a file (rather than printing to stdout)
... do whatever you want to capture, then ^C to stop it ...
分析
1234
// Copy capture.pcap to computer
$ adb -d pull /sdcard/capture.pcap /path/to/capture.pcap
Analyze with Wireshark.