1、打開命令終端,輸入命令: open -e .bash_profile,打開bash_profile配置文件
2、寫入如下內(nèi)容(NDK_HOME指向 ndk-build 所在路徑):
export NDK_HOME=/Users/xc/SDK/android-sdk-macosx/ndk/20.1.5948944
export PATH=NDK_HOME
3、生效.bash_profile配置 source .bash_profile

image.png
當(dāng)在Terminal中執(zhí)行 ndk-build 命令時(shí),如果出現(xiàn)下圖所示內(nèi)容,則代表配置成功了:

image.png