一、賦上最新版本的Android NDK下載鏈接
ndk_r12 (June 2016)
Windows 32-bit : http://dl.google.com/android/repository/android-ndk-r12b-windows-x86.zip
Windows 64-bit : http://dl.google.com/android/repository/android-ndk-r12b-windows-x86_64.zip
Mac OS X 64-bit : http://dl.google.com/android/repository/android-ndk-r12b-darwin-x86_64.zip
Linux 64-bit (x86) : http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip
二、下載對應的版本按照其下方式解壓至你所要安裝的目錄
三、解壓完之後我這裏爲了區分各個版本,方便管理,我重名爲r12b,修改配置文件 /etc/profile
[root@localhost ndk]# gedit /etc/profile
添加命令:
export ANDROID_NDK_HOME=/usr/local/android/ndk/r12b
export PATH=$ANDROID_NDK_HOME:$PATH
關閉保存;使之生效:
[root@localhost ndk]# source /etc/profile
四、驗證NDK,切換至ndk目錄 執行編譯命令
[root@localhost r12b]# ndk-build
顯示爲以上的表示安裝成功,大功告成!