編輯:高級開發
http://source.android.com/porting/tcpdump.Html
Source Code and Documents
http://www.tcpdump.org/
Compiled Binary Download
http://www.strazzere.com/android/tcpdump
數據包分析工具Wireshark
http://www.wireshark.org/download.Html
Installing tcpdump
Pushing the binary to an existing device
Download tcpdump from http://www.tcpdump.org/, then execute:
Cmd代碼
adb root
adb remount
adb push /wherever/you/put/tcpdump /system/xbin/tcpdump
adb shell chmod 6755 /data/local/tmp/tcpdump
adb root
adb remount
adb push /wherever/you/put/tcpdump /system/xbin/tcpdump
adb shell chmod 6755 /data/local/tmp/tcpdump
Running tcpdump
You need to have root Access on your device.
Batch mode capture
The typical procedure is to capture packets to a file and then examine the file on the desktop, as illustrated below:
Cmd代碼
adb shell tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
# "-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 you want to capture, then ^C to stop it ...
adb pull /sdcard/capture.pcap .
sudo apt-get install wireshark # or ethereal, if you're still on dapper
wireshark capture.pcap # or ethereal
... look at your packets and be wise ...
adb shell tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
# "-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 you want to capture, then ^C to stop it ...
adb pull /sdcard/capture.pcap .
sudo apt-get install wireshark # or ethereal, if you're still on dapper
wireshark capture.pcap # or ethereal
... look at your packets and be wise ...
You can run tcpdump in the background from an interactive shell or from Terminal. By default, tcpdump captures all traffic without filtering. If you prefer, add an expression like port 80 to the tcpdump command line.
Real time packet monitoring
Execute the following if you would like to watch packets go by rather than capturing them to a file (-n skips DNS lookups. -s 0 captures the entire packet rather than just the header):
Cmd代碼
adb shell tcpdump -n -s 0
adb shell tcpdump -n -s 0
Typical tcpdump options apply. For example, if you want to see HTTP traffic:
Cmd代碼
adb shell tcpdump -X -n -s 0 port 80
android應用操作系統均采用了軟件堆層(software stack,又名軟件疊層)的架構,主要分為三部分:低層以Linux核心工作為基礎,只提供基本功能,下文僅供
Dashboard,一種專門針對入口界面設計的應用程序,Dashboard (為儀表板之意)原來是蘋果公司 Mac OS X v10.4 Tiger 作業系統中的應用程
android手機平台強大之處還有許多,在這裡我們先涉及一些android操作系統的基本特性,許多的功能在在咱們國內是不可能實現了,不過目前已經支持中文的語音搜索還是看
理解布局對於良好的android程序設計非常重要。在這個教程裡,你將學到相對布局的所有知識,相對布局用於將用戶界面控件或小工具相對於其它控件或它們的父級布局組織在屏幕上