从官网下载后得到一个bin文件
然后输入
ndk$ chmod a+x android-ndk-r10e-linux-x86_64.bin ndk$ ./android-ndk-r10e-linux-x86_64.bin会的到一个 android-ndk-r10e 文件夹
然后把文件夹移到 /opt 文件夹下
sudo mv android-ndk-r10e /opt/
接着修改 /etc/profile
输入 sudo vim /etc/profile
在最后加上
#set NDK env
export NDKROOT="/opt/android-ndk-r10e"
export PATH=$NDKROOT:$PATH
保存退出
输入source /etc/profile 让配置文件生效
然后测试ndk是否生效
输入 ndk-build
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/opt/android-ndk-r10e/build/core/build-local.mk:143: *** Android NDK: Aborting . Stop.
出现上面的内容说明已经生效