To use the NDK from anywhere, add it to your PATH. Open your shell configuration file (~/.bashrc, ~/.zshrc, or ~/.profile).
nano ~/.bashrc
Add these lines at the end:
export ANDROID_NDK_HOME=/opt/android-ndk-r23b
export PATH=$PATH:$ANDROID_NDK_HOME
Save, then reload:
source ~/.bashrc
sudo unzip android-ndk-r23b-linux-x86_64.zip -d /opt/
Let’s execute the download from the command line using wget or curl. download androidndkr23blinuxx8664zip top
Before extracting, ensure the file is not corrupted. Google publishes the official SHA-1 checksum for r23b.
The official SHA-1 for android-ndk-r23b-linux-x86_64.zip is:
8b18b48f5e734622664b5ae9cd55255e21aa5d62 To use the NDK from anywhere, add it to your PATH
Verify it using:
sha1sum android-ndk-r23b-linux-x86_64.zip
Expected output: 8b18b48f5e734622664b5ae9cd55255e21aa5d62 android-ndk-r23b-linux-x86_64.zip Save, then reload:
source ~/
If the checksum matches, you have the top-tier, authentic file. If it does not match, delete the file and re-download.
~/Android/android-ndk-r23c/ndk-build --version
You should see GCC 4.9 (yes, still included!) alongside Clang.