Cross Compile - tcpdump for x86

后端 未结 1 1472
庸人自扰
庸人自扰 2021-01-04 01:38

I need tcpdump binary for android-x86. Here is what I have done:

sudo apt-get install gcc-i686-linux-android
sudo apt-get install          


        
相关标签:
1条回答
  • 2021-01-04 02:16

    Alternatively, you can build tcpdump with NDK using this script build-android-tcpdump.

    Steps:

    1. Install NDK: NDK download

    2. Download build-android-tcpdump and simply run:

      sh build-android-tcpdump -n "/PATH/TO/NDK" -t 4.9.0 -l 1.8.1

    That's it, it will build tcpdump for all Android arches by default, including x86.

    root@generic_x86:/data/local/tmp # uname -srm                                  
    Linux 3.10.0+ i686
    
    root@generic_x86:/data/local/tmp # ./tcpdump  -h                               
    tcpdump version 4.9.0
    libpcap version 1.8.1
    Usage: tcpdump [-aAbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ]
            [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
            [ -i interface ] [ -j tstamptype ] [ -M secret ] [ --number ]
            [ -Q in|out|inout ]
            [ -r file ] [ -s snaplen ] [ --time-stamp-precision precision ]
            [ --immediate-mode ] [ -T type ] [ --version ] [ -V file ]
            [ -w file ] [ -W filecount ] [ -y datalinktype ] [ -z postrotate-command ]
            [ -Z user ] [ expression ]
    
    0 讨论(0)
提交回复
热议问题