Search code examples
androidubuntuandroid-emulatortcpdump

Android emulator fails to start when used with tcpdump-option


When I run an AVD from the Terminal on Ubuntu 14.04, the following command is working without problems:

my_name@host:~$ emulator -avd my_avd

But when I want to use tcpdump to capture the network-traffic, the emulator fails to start:

my_name@host:~$ emulator -avd my_avd -tcpdump ~/test.cap
qemu-system-i386: -tcpdump: invalid option

I have no problems running the emulator with tcpdump on Windows, but on Ubuntu and Debian it refuses to work. Might this be a Bug or am I missing something? The same problem occurrs when I want to use the option -timezone Europe/Berlin. In contrast, the option -dns-option 8.8.8.8 is working fine. The problem occurrs for every AVD.

Android SDK:

  • SDK Tools 25.1.1
  • Platform-Tools 23.1
  • Build-Tools 23.0.3
  • Android 6.0 SDK Platform Revision 3
  • Android 6.0 (Intel x86 Atom Image 32/64 Bit Revision 8 and ARM EABI v7a Image Revision 3)

Virtualization (KVM) is enabled on Intel Core 2 Duo. Oracle JDK 8 is installed.


Solution

  • The same behavior occurred on my Mac, the solution seems to be to add -engine classic to your command line call. So it reads:

    my_name@host:~$ emulator -avd my_avd -tcpdump ~/test.cap -engine classic
    

    Credits go to @Interix for posting this here