How to compile tcpdump for Android 5.* (Lollipop)

The linked github project (chatch/tcpdump-android) contains a shell-script to compile libpcap + tcpdump for ARM based Android devices. However it's a bit outdated, it was never maintained after the initial commits. The source ( for the script is outdated as well. I've taken the time to update the script to the most current libpcap+tcpdump+ndk versions and added Lollipop compatiblity (i.e. PIE support).

The setup that I used for testing is:
  • Ubuntu 14.04.2 (64 bit)
  • Android NDK rev 10e (64 bit)
  • Libpcap v1.7.4, Tcpdump v4.7.4
The shell-script assumes you've lex and yacc. If not and you've a recent Debian based system, just run the following:
sudo apt-get install flex bison

Before you run the shell-script, you've to download the NDK package (, extract it and specify the NDK variable to point to the NDK dir.

That's pretty much all you've to do. And execute the shell-script of course. Smile

P.S.: well ... it turns out I should just have googled for the solution since somebody already did all this. Smile Never mind.

build-tcpdump.sh4.99 KB
Syndicate content