Use TCP dump to capture packets in Android

Source: Internet
Author: User

Tcpdump for Android (TCP packet capture tool)

To capture TCP data packets, you can use the tcpdump tool, similar to the tool used in Windows/Linux.

The specific method is to downloadTcpdump, There is a http://www.strazzere.com/android/tcpdump address, please refer to the document in http://www.tcpdump.org/

You need root permission,

ADB Root

ADB remount

ADB push c: \ wherever_you_put \Tcpdump/Data/local/Tcpdump
ADB shell chmod 6755/data/local/Tcpdump

Packet Capture is simple

ADB shell tcpdump-W/data/capture0.pcap

ADB shell tcpdump IP 10.1.2.13 and 10.2.3.12-W/data/capture1.pcap

Or
ADB ShellTcpdump-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...
Export

ADB pull/data/capture0.pcap/home/Linghu/

ADB pull/sdcard/capture. pcap/home/Linghu/


Download Wireshark to view the data packet. The address is http://www.wireshark.org/download.html. Open this data packet and you can see it in the data packet.

Reference: http://prem-android.blogspot.com/2009/03/capture-packets-in-android-tcpdump.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.