adb root
adb remount
adb push /wherever/you/put/tcpdump /system/xbin/tcpdump
adb shell chmod 6755 /data/local/tmp/tcpdump
adb shell tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
# "-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 ...
adb pull /sdcard/capture.pcap .
sudo apt-get install wireshark # or ethereal, if you're still on dapper
wireshark capture.pcap # or ethereal
... look at your packets and be wise ...
adb shell tcpdump -n -s 0
adb shell tcpdump -X -n -s 0 port 80
1.下载tcpdump
下载地址:
<a href="http://www.pocketdigi.com/wp-content/uploads/downloads/2011/10/tcpdump.zip">http://www.pocketdigi.com/wp-content/uploads/downloads/2011/10/tcpdump.zip</a>
参考来源1:
<a href="http://bbs.lephone.cc/thread-104252-1-1.html">http://bbs.lephone.cc/thread-104252-1-1.html</a>
另外网上也有提供tcpdump下载的来源2:
<a href="http://www.cnblogs.com/likwo/archive/2012/09/06/2673944.html">http://www.cnblogs.com/likwo/archive/2012/09/06/2673944.html</a>
但是个下载来用会报systag error,不过以上两个来源写的方法基本是靠谱的;
2.下载wireshark(分析工具,也可用于win平台抓包)
参考官网:
<a>http://www.wireshark.org/download.html</a>