I would like to monitor network traffic of my Android Phone. I was thinking using tcpdump for Android, but I\'m not sure if I have to cross-compile for the phone.
An
If you are doing it from the emulator you can do it like this:
Run emulator -tcpdump emulator.cap -avd my_avd
to write all the emulator's traffic to a local file on your PC and then open it in wireshark
There is a similar post that might help HERE
Packet Capture is the best tool to track network data on the android. DOesnot need any root access and easy to read and save the calls based on application. Check this out
Without root, you can use debug proxies like Charlesproxy&Co.
Note: tcpdump requires root privileges, so you'll have to root your phone if not done already. Here's an ARM binary of tcpdump (this works for my Samsung Captivate). If you prefer to build your own binary, instructions are here (yes, you'd likely need to cross compile).
Also, check out Shark For Root (an Android packet capture tool based on tcpdump).
I don't believe tcpdump can monitor traffic by specific process ID. The strace method that Chris Stratton refers to seems like more effort than its worth. It would be simpler to monitor specific IPs and ports used by the target process. If that info isn't known, capture all traffic during a period of process activity and then sift through the resulting pcap with Wireshark.
The DDMS tool included in the Android SDK includes a tool for monitoring network traffic. It does not provide the kind of detail you get from tcpdump and similar low level tools, but it is still very useful.
Oficial documentation: http://developer.android.com/tools/debugging/ddms.html#network