1. 手机要有root权限

2. 下载tcpdump   http://www.strazzere.com/android/tcpdump

3. adb push c:\wherever_you_put\tcpdump /data/local/tcpdump

如果这一步真机无法push,可以用adb push c:\where_you_put\tcpdump /sdcard,即先将文件存入不需要权限的文件夹中,这里用sdcard,然后在传到/data/local/tcpdump。

4. adb shell chmod 6755 /data/local/tcpdump

5, adb shell,   su获得root权限

6, cd /data/local

7, ./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 ...

下载tcpdump文件到电脑 

 adb pull /sdcard/capture.pcap capture.pcap 


然后用wireshark打开即可看到数据包的详细信息。


更多相关文章

  1. Linux下 解包/打包 Android(安卓)映像文件 system.img, boot.img
  2. android 基于百度地图api获取经纬度
  3. Android(安卓)Studio 关联项目软链接
  4. android flutter打包 apk 及接facebook 及google登录的密钥生成
  5. Android(安卓)批量读取APK 包名,版本信息
  6. [Android(安卓)Studio导入第三方类库方法] Error:(19, 23) 错误:
  7. Android(安卓)Studio 引入 Fresco
  8. android恶意程序分析 (四)
  9. NPM 和webpack 的基础使用

随机推荐

  1. android下拉弹出框
  2. Creating Android live wallpaper
  3. android LinearLayout嵌套 button时onCli
  4. ch011 Android Galley与ImageSwitch
  5. Android ListView
  6. android屏幕分辨率适配
  7. 引路蜂Android游戏编程教程
  8. Android传感器
  9. Android Lollipop新特性
  10. Android LinearLayout等配置圆角背景