Two days ago, I made an android client and found that the reported data is not the same as the expected data. I can only view the client request data and server response data, and found the error. On the Internet, Baidu found that tcpdump can solve the problem. I will share with you the process. Test Machine root is required! The test machine without root must be root. otherwise
Two days ago, I made an android client and found that the reported data is not the same as the expected data. I can only view the client request data and server response data, and found the error.
Baidu discovery on the InternetTcpdumpThis can solve the problem and I will share with you the process.
Test Machine root is required! Root is required for a test machine without root. Otherwise, the tcpdump software must be downloaded ).
1. connect the test machine to your computer and open the windows Command Prompt window;
2. copy the tcpdump program to the android mobile phone.
In the command prompt window, enter adbpush c:/tcpdump/data/local/tcpdump ("c:/tcpdump" is the address of the local tcpdump software, "/data/local/tcpdump" for the destination mobile address)
Note: When executing this command, make sure that only one test machine is connected and the simulator is not enabled. Otherwise, an error "error: more than one device and emulator" will be reported.
3. modify tcpdump permissions
Enter adbshell chmod 6755/data/local/tcpdump in the command prompt window.
4. enter the root permission on the mobile phone.
Enter adbshell in the command prompt window.
$ Is displayed on the root phone.
Enter the "su" command again to access the root permission of the mobile phone, and change the cursor to "#".
5. run tcpdump software
Enter/data/local/tcpdump-p-vv-s 0-w/sdcard/capture. pcap in the command prompt window.
Note: The test machine must be connected to the network.
6. execute the operations on the mobile phone end that require packet capture analysis. after the execution is complete, execute Ctrl + C in the command prompt window to interrupt the packet capture process.
7. copy the packet capture result to the local device.
Enter adbpull/sdcard/capture. pcap c:/in the command prompt window :/
If you place it elsewhere, you can change "c:/" to what you need.
8. use relevant software to view the captured File capture. pcap. here I use Wireshark software to view the analysis (Wireshark download ).
The error is analyzed.