android NDK install and config in ubuntu

下载适合你的NDK 从下面的网址

(https://developer.android.com/ndk/downloads/index.html#download “android 官网下载地址”)

下载之后把文件拖到想要安装的目录 directory ,添加执行权,并且运行

cd directory
chmod a+x android-ndk-r10c-darwin-x86_64.bin
 ./android-ndk-r10c-darwin-x86_64.bin

配置 环境变量

sudo gedit /etc/profile
# add the next commands to the last line
export ANDROID_NDK=you ndk path
export PATH=$ANDROID_NDK:$PATH

android NDK install and config in ubuntu_第1张图片

confirm you config

sudo source /etc/profile
cd you ndk path/samples/hello-jni
ndk-build

If you have successfully installed and configured the NDK, the screen on your target device looks as shown in Figure 1.

android NDK install and config in ubuntu_第2张图片

配置成功!

你可能感兴趣的:(android,android,ubuntu,NDK,安装和配置)