The mac platform uses adb and tcpdump tools to capture the network package of android phones and tcpdumpandroid

Source: Internet
Author: User

The mac platform uses adb and tcpdump tools to capture the network package of android phones and tcpdumpandroid

When developing a mobile app, we want to check the network requests sent by our app. In this case, we need tcpdump to capture packets. To implement tcpdump, you need to take the following steps:

The following uses the android mobile phone Huawei P6 as an example.

1. Mobile phone ROOT

To use the tcpdump tool, you must first obtain the root permission of the mobile phone, try several root tools, and finally find that the 360 one-click ROOT tool can root the P6 Machine

Download the 360 one-click root tool for PC, connect the mobile phone to the computer with a USB cable, and enable USB debugging (Settings> developer Options> USB debugging)

Then, follow the prompts to run the ROOT command.


2. Download the adb Tool

At the beginning, I downloaded the adb of the earlier version from the Internet, but it never succeeded and showed offline. At this time, you have to download the adb of the latest version.

One way is to download an ADT from the developer android http://developer.android.com/sdk/index.html, there is the latest adb

The other is to download the latest 1.0.31, Which is uploaded by adb,


3. After downloading the adb, you can test its version and run the cd command to its directory.



4. Then,Unauthorized is found when you use the adb devices command. In this case, you need to disable the developer option of the mobile phone before enabling it, and then obtain authorization.


If you get authorization, your computer will be in ~ /. Copy the key in the android directory to the mobile phone.


Reference blog: http://blog.csdn.net/quicksand201/article/details/19190821

After this step is completed, you can use adb shell. After Entering adb devices, the following result is displayed:


5. Download tcpdump

For: http://www.strazzere.com/android/tcpdump

Then copy the downloaded tcpdump to a directory on the mobile phone.

Then log on with the adb shell. After logging on, use the su command to switch to the root user, go to the tcpdump directory, and add the executable permissions of tcpdump (use chmod 777 tcpdump)




6. Use tcpdump,Open your app and you will be able to see its packet capture information.




How to capture network data packets of android mobile client applications in Windows 7

This is no different from the data packets of other computers that capture the same LAN. No matter what platform, the network data packets sent are the same protocol. You only need a common packet capture software.

Use of tcpdump on Android platforms

"Tcpdump-P-VV-S 0-W/SD card/capture. pcap"); the highest realm of love through Eclipse compiler... is able to withstand the plain flow of years. Wood is the most beautiful hou in the world. This is an old man...
 

Related Article

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.