This article references others' articles and detailed steps:
I. 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 the path should not contain spaces! After the input is complete, Control + x is saved, and then the system prompts whether to save it. Enter y and press Enter!
5. Test the path step: Close your terminal and re-open it. If there is a problem with the previous path configuration, the following prompt will appear when you re-open the terminal:-bash: exoort: command not found. If no such prompt is displayed, "OK" indicates that the path configuration is complete!
6. Enter ndk-build. If the response is correct, the configuration path is successful.
7. cd to the project to be compiled, ndk-build, and compilation successful. OK.