要安装和使用 android-ndk-r26b-linux.zip,您可以参考以下步骤:
- 将 android-ndk-r26b-linux.zip 文件下载到您的 Linux 系统中,您可以从 Android 开发者网站 或 CSDN 文库 获取该文件。
- 在终端中,使用 unzip 命令解压该文件,例如:
$ unzip android-ndk-r26b-linux.zip
- 这将创建一个名为 android-ndk-r26b 的目录,您可以将其移动到您喜欢的位置,例如 /usr/local 目录。
- 在终端中,编辑您的 ~/.bashrc 文件,添加以下内容,将 NDK 的路径添加到您的环境变量中:
export NDKROOT=/usr/local/android-ndk-r26b
export PATH=$NDKROOT:$PATH
- 在终端中,运行 source ~/.bashrc 命令,使更改生效。
- 在终端中,运行 ndk-build --version 命令,检查您是否正确安装了 NDK,您应该看到类似以下的输出:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
以上就是安装和使用 android-ndk-r26b-linux.zip 的基本步骤。如果您想了解更多关于 NDK 的信息,请参考 NDK 开发指南123。