This article refers to other people’s articles, detailed steps:
1. Start Terminal
2. Enter pico .bash_profile and press Enter.
3. Enter the following content [the path depends on the actual situation]:
[php]
export ANDROID_SDK_ROOT=/Users/apple/Desktop/adt-bundle/sdk
export ANDROID_NDK_ROOT=/Users/apple/Documents/Android/android-ndk-r8e
export PATH=$PATH:$ANDROID_SDK_ROOT
export PATH=$PATH:$ANDROID_NDK_ROOT
export ANDROID_TOOL=/Users/apple/Desktop/adt-bundle/sdk/platform-tools
export PAHT=$PATH:$ANDROID_TOOL
export ANDROID_SDK_ROOT=/Users/apple/Desktop/adt-bundle/sdk
export ANDROID_NDK_ROOT=/Users/apple/Documents/Android/android-ndk-r8e
export PATH=$PATH:$ANDROID_SDK_ROOT
export PATH=$PATH:$ANDROID_NDK_ROOT
export ANDROID_TOOL=/Users/apple/Desktop/adt-bundle/sdk/platform-tools
export PAHT=$PATH:$ANDROID_TOOL
4. Note that it is best not to have spaces in the path! After the input is completed, Control+x to save, and then prompted whether to save, enter y, and finally press Enter!
5. Steps to verify the path: Close your "terminal" and reopen it. If there was a problem with the previous path configuration, the following prompt will appear in the re-opened "terminal": -bash: exoort: command not found If there is no such prompt, OK Description path configuration is complete!
6. Enter ndk-build. If there is a response, the configuration path is successful.
7. cd to the project to be compiled, ndk-build, the compilation is successful. OK, get it done.