Jake Petroules
Jake Petroules

Reputation: 24160

How do I install the Android NDK bundle using the command line?

The Android NDK can now be installed directly from the SDK manager instead of only as a separate download. How can I install the NDK package from the command line?

I've tried:

android sdk update -u -n -a

but no NDK package appears to be visible in the listing. It only shows up in the UI.

Upvotes: 22

Views: 30411

Answers (2)

ralf htp
ralf htp

Reputation: 9422

In Android Studio 2.3 is sdkmanager tool

It is located in the sdk directory (i.e. ~/Android/Sdk/tools/bin)

to get a list of installed and available packages goto the directory where the sdkmanager binary is located and type ./sdkmanager --list

to install NDK directly use ./sdkmanager "ndk-bundle"

(./sdkmanager "lldb;2.3", ./sdkmanager "cmake;3.6.3155560")

https://developer.android.com/studio/command-line/sdkmanager.html

Upvotes: 37

shtolik
shtolik

Reputation: 1368

  1. Download zip file of required version of ndk from developer.android.com. E.g. for linux:

    wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip

  2. Extract zip to some folder, e.g. c:/android/android-ndk-r13b/

  3. Add/update the path to that folder in the local.properties file of your application.

    ndk.dir=c:\android\android-ndk-r13b

Upvotes: 8

Related Questions