TCPDUMP for Android(抓TCP数据包工具)
16lz
2021-01-26
转自:http://swverification.blog.sohu.com/144706366.html
如果要抓TCP数据包,我们可以使用TCPdump工具,类似于windows/linux下使用的这个工具一样。具体方法是
下载tcpdump, 还有个地址是http://www.strazzere.com/android/tcpdump,不知道具体版本。
详细使用请参考http://www.tcpdump.org/里面的文档
你需要root权限,
adb push c:\wherever_you_put\tcpdump /data/local/tcpdumpadb shell chmod 6755 /data/local/tcpdump抓包很简单adb shell tcpdump -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 ...导出adb pull /sdcard/capture.pcap .下载wireshark查看数据包,地址是http://www.wireshark.org/download.html,打开这个数据包,就可以查看数据包内容了。
参考文档:http://prem-android.blogspot.com/2009/03/capture-packets-in-android-tcpdump.html
http://nerdjusttyped.blogspot.com/2009/03/android-binary-solo.html
更多相关文章
- [Android]获取设备IP地址
- Android(安卓)2.2 r1 API中文文档—— Toast
- 使用ViewServer让Android真机可用HierarchyView视图检测工具
- android settings学习笔记(一)
- Android学习之反编译工具介绍
- 在Android(安卓)Studio中修改maven私库的地址
- Cocos2d-x的Android配置以及相关参考文档
- Android(安卓)性能优化 二 TraceView工具的使用
- android下载简单工具类