Tcpdump for Android (TCP packet capture tool)
To capture TCP data packets, you can use the tcpdump tool, similar to the tool used in Windows/Linux.
The specific method is to downloadTcpdump, There is a http://www.strazzere.com/android/tcpdump address, please refer to the document in http://www.tcpdump.org/
You need root permission,
ADB Root
ADB remount
ADB push c: \ wherever_you_put \Tcpdump/Data/local/Tcpdump
ADB shell chmod 6755/data/local/Tcpdump
Packet Capture is simple
ADB shell tcpdump-W/data/capture0.pcap
ADB shell tcpdump IP 10.1.2.13 and 10.2.3.12-W/data/capture1.pcap
Or
ADB ShellTcpdump-P-VV-S 0-W/sdcard/capture. pcap
# "-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...
Export
ADB pull/data/capture0.pcap/home/Linghu/
ADB pull/sdcard/capture. pcap/home/Linghu/
Download Wireshark to view the data packet. The address is http://www.wireshark.org/download.html. Open this data packet and you can see it in the data packet.
Reference: http://prem-android.blogspot.com/2009/03/capture-packets-in-android-tcpdump.html