您的位置:首页 > 理论基础 > 计算机网络

How to use tcpdump on Android

2015-06-24 12:12 561 查看
Build tcpdump with Android source code,
you can do by this(Use nexus 7 I for example):

1. Go to your code root path.
2. source ./build/envsetup.sh; lunch aosp_grouper-userdebug
3. make -j4 tcpdump

You should get tcpdump under folder out/target/product/grouper/system/xbin

Steps to use tcpdump:

On PC:

adb root

adb remount

adb push tcpdump /system/xbin/

adb shell chmod 0755
/system/xbin/tcpdump

adb shell

On device:

Run the following command:
tcpdump -p -vv -s 0 -w <file on device to save the data> -i wlan0 host <server IP>

Sample:

tcpdump -p -vv -s 0 -w /sdcard/capture.pcap -i wlan0 host 192.168.1.10

On PC:

adb pull /sdcard/capture.pcap .

then you can use wireshark to read the data.

Useful links

详解使用tcpdump、wireshark对Android应用程序进行抓包并分析

CAN NOT LINK EXECUTABLE
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: