What's the best way to capture packets sent and received by my own android app?

2.8k Views Asked by At

I'm a developer of a VOIP calling app who's trying to troubleshoot connectivity issues.

I'd like to ship something in production that uploads pcap traces of it's own calls - particularly ones that drop, have high amounts of noise, or other nastiness.

There seem to be external apps (some of which require root) for capturing the network traffic of all apps - but no library that I can embed in my app and ship to help me debug.

Is there an easy to use solution for this?

2

There are 2 best solutions below

0
On

1. Wireshark

Run Wireshark on your laptop and setup your laptop as a hotspot. Connect your device to your laptop's hotspot, then run. Wireshark will capture all packets.

2. ADB

adb root > remount > shell

$su > tcpdump -w /sdcard/tcp > [CTRL-C] to stop > exit

adb pull /sdcard/tcp
0
On