ADB:
adb devices: Use the next sentence to query 5037 port occupancy when failed
Netstat-ano | findstr 5037: then view the occupied PID and close the occupancy program.
tcpdump Grab Bag :
1. Download Tcpdump http://download.csdn.net/detail/happylisher/8035645
3. adb push c:\wherever_you_put\tcpdump /data/local/tcpdump
4. adb shell chmod 6755/data/local/tcpdump
5, adb shell, su get root permission
6, Cd/data/local
7,./tcpdump-i Any-p-S 0-w/sdcard/capture.pcap
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 ...
8, ADB pull/sdcard/capture.pcap d:/
9, on the computer with Wireshark open Capture.pcap can analyze log
Execute The following if you would like to watch packets go by rather than capturing them to a file (-N skips DNS look Ups. -S 0 captures the entire packet rather than just the header):
adb shell tcpdump -n -s 0
typical tcpdump options apply. For example, if you want to see HTTP traffic:
Listen only for HTTP
adb shell tcpdump-x-n-s0Port the
Based on the above information, write a bat to execute (the tcpdump file must be in the current directory).
Start tcpdump
ADB push Tcpdump/data/local/tcpdump
ADB shell chmod 6755/data/local/tcpdump
ADB Shell Rm-r/sdcard/capture.pcap
ADB shell/data/local/tcpdump-i any-p-S 0-w/sdcard/capture.pcap
Pause
Download tcpdump file to your computer
ADB pull/sdcard/capture.pcap Capture.pcap
Some of the commands of the Android grab and some considerations for ADB use