In the development process encountered problems, can not be very convenient to obtain the packet, resulting in analysis to solve the problem is more troublesome. Here's how to implement Tcpdump capture on your Android phone.
1. Root machine
In the process of using tcpdump to grab the package, you need to use root permissions. There are many ways to root now, personal recommendation http://root.baidu.com/, installation and use is very convenient. 2. Prepare ADB Tools
ADB is a bug debug tool that comes with the Android phone Development Kit, which makes it very easy to debug the Android machine via PC, and durable it in the process of using it to execute shell commands on Android 1) adb shell, Execute the android shell command directly in the command terminal of the PC (you can also execute the shell command by installing the command terminal on the Android machine, it is not easy to use the ADB shell, but it is also a method) 2) ADB push Local remote, push files on your PC to the path above the Android machine 3) ADB pull remote local, pulled from the file above the Android machine to the path specified by the PC
3, installation tcpdump Android system although originated from the Linux operating system, for the requirements of the handheld device environment, it is unavoidable to simplify castration, wherein tcpdump This debug analysis artifact, in the ranks of castrated. For normal use of tcpdump, we need to install a tcpdump in the Android system, the main steps are: 1) Download the tcpdump package to provide a tcpdump package: http://www.strazzere.com/android/tcp Dump 2) upload tcpdump package to Android machine ADB push d:\tcpdump/data/local/tmp Remote Installation directory needs to be customized according to the situation 3) execution chmod 0777 tcpdump command, give executable permission (execution chmod a+x tcpdump reflection failure, not yet understood why) 4, crawl the data to this end, basically has completed the preparatory work. The specific use of the tcpdump command can be found in the Tcpdump Manual (http://www.tcpdump.org/). During the actual operation, follow the command to execute the packet in Linux: Tcpdump-xnlps0-i any port 80-w Pcap.cap, but told Tcpdump:syntax Error, viewing the Help document found that port type filtering is not supported, To this end, the grab Packet command is simplified to:./tcpdump-xnlps0-w Pcap.cap, Pound, will all the bags are captured, on the PC machine with Wireshark is also quite feasible. 5, the analysis of data as described above, the direct use of Wireshark to analyze the data is more convenient.
Android phone tcpdump Grab Bag