Android tcpdump Grab Bag

Source: Internet
Author: User

(1) Copy the Android tcpdump command to the/data/local/tools/directory and add the executable permission
(2) Create a new adbtcpdump.sh file on your local computer with the following contents:
#!/bin/bash

Filename= ' Date +%f-%h-%m-%s ' ". Cap"
Filepath= "/data/local/tmp"

Pullfile ()
{
# echo $filepath/$filename
adb shell "Su-c ' chmod 777 $filepath/$filename '"
ADB pull $filepath/$filename
adb shell "su-c ' rm-f $filepath/$filename '"
}

#trap "Pullfile; Exit "0 1 2 3 9 15

# when you press CTRL + C, execute the Pullfile function
Trap "PULLFILE; Exit "2

adb shell "Su-c '/data/local/tools/tcpdump-p-vv-s 0-w $filepath/$filename '"
(3) When grasping the package, execute the./adbtcpdump.sh file, and at the end press CTRL + C.

Note: The phone must be root already



Android tcpdump Grab Bag

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.