Search code examples
ubuntuandroid-ndkinstallation

How to install android ndk in linux?


I have downloaded android NDK from here: http://developer.android.com/tools/sdk/ndk/index.html
for Linux 64-bit (x86) android-ndk-r10c-linux-x86_64.bin. How I do install it? The instructions don't work. My OS is

57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Solution

  • The Standard Way

    Android's NDK now ships as an self extracting executable. You likely need to set the executable bit:

    $ chmod +x android-ndk-r10c-linux-x86_64.bin
    $ ./android-ndk-r10c-linux-x86_64.bin
    

    The above will cause the NDK to extract into the current working directory.

    Manual Extraction

    Since the .bin file is really just a 7-Zip self extracting archive, you can manually extract the contents if needed:

    $ 7za x -o/path/to/extract/to/ android-ndk-r10c-linux-x86_64.bin
    


    7-Zip is available in Ubuntu for example via apt-get:

    $ sudo apt-get install p7zip-full
    

    Update
    As of at least r14b on the NDK download page, we're back to standard ZIP archives.