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
Preconditions: adb and wireshark are installed on your computer and you have a rooted android device.
adb push ~/Downloads/tcpdump /sdcard/adb shellsu rootmv /sdcard/tcpdump /data/local/cd /data/local/chmod +x tcpdump./tcpdump -vv -i any -s 0 -w /sdcard/dump.pcapCtrl+C once you've captured enough data.exitexitadb pull /sdcard/dump.pcap ~/Downloads/Now you can open the pcap file using Wireshark.
As for your question about monitoring specific processes, find the bundle id of your app, let's call it com.android.myapp
ps | grep com.android.myapp/data/local using the same way you did for tcpdump above. cd /data/local./strace -p 1234 -f -e trace=network -o /sdcard/strace.txtNow you can look at strace.txt for ip addresses, and filter your wireshark log for those IPs.