Reference: http://www.cnblogs.com/likwo/archive/2012/09/06/2673944.html
Recently, because of testing needs, to catch the mobile app package.
A. The phone must have root authority
B. Download Tcpdump http://www.strazzere.com/android/tcpdump
C. Use adb push to copy tcpdump files to/data/local in the original text but when I do this, I find that the permissions are not enough (the phone is root) switch with the manager to run CMD or not, and finally decided to directly on the phone through the re browser directly to the tcpdump copy to/ The data/local directory.
D. running ADB shell
1 adb Shell 2 su //Here the root manager of the phone will pop up to allow, click Allow to switch from $ to #3# run tcpdump grab bag 4 ./data/local/tcpdump-i Any-p-S 0
Command parameters:
# '-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 your want to capture and then ^c to stop it ...
Grab the packet according to the port:
1 adb shell tcpdump-x-n-s 0 Port 80
Write the captured content to a file for easy use Wireshark
1 ./data/local/tcpdump-i any-p-S 0-w/mnt/sdcard0/test.cap
Android under Tcpdump grab Bag