如果要抓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/tcpdump

adb shell chmod 6755 /data/local/tcpdump

抓包很简单

adb shelltcpdump-p -vv -s 0 -w /sdcard/capture.pcap

adb shell su /data/local/./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,打开这个数据包,就可以查看数据。

参考资料:

1.Linux tcpdump命令详解:http://www.cnblogs.com/ggjucheng/archive/2012/01/14/2322659.html

更多相关文章

  1. Android(安卓)Studio 解决build.gradle运行编译报错问题
  2. apk 反编译 教程 (不支持混淆,Android)
  3. CoderPig’s Android(安卓)Study Note——目录
  4. Linux,maven,redis,android,java,yum,ant部署相关命令
  5. Ionic 程序打包发布Android版本
  6. 【叨、校长】Android报表工具AChartEngine初探总结
  7. Android攻城狮—全套必备神级工具(开发,插件,效率)
  8. android-adb调试与sqlite远程shell(android调试桥)
  9. android的http工具类

随机推荐

  1. Android进程间通信--消息机制及IPC机制实
  2. 转:android在文本TextView中添加超链接
  3. android 横竖屏判断
  4. android 控件学习笔记 --------ViewPager
  5. Android编译过程详解(一)
  6. android监听来电去电广播
  7. Android(安卓)Media Scanner Mechanism A
  8. Android(安卓)四种定时器的写法
  9. Android获取手机和应用的相关信息
  10. Android(安卓)Lights