Skip to content

About

I help for people who wants to install Android SDK on their phone with the help of AndroidIDE

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AndroidIDE Native NDK & CMake Installer

Automated ARM64 (aarch64) Native C/C++ Toolchain Setup for Android On-Device Development

A robust, dependency-aware automated installer that configures community-built native aarch64 Android NDKs and CMake toolchains for AndroidIDE and Termux — enabling on-device compilation of native C/C++ Android projects without a PC.

Architecture: aarch64 Environment: AndroidIDE License: MIT Stars

⚡ One-Line Install • ✨ Why This Exists • 📦 Supported Versions • ⚙️ CLI Usage • 🔧 AndroidIDE Setup


⚡ One-Line Quick Install

Run this single command inside the AndroidIDE Terminal or Termux:

Using curl:

curl -sL https://raw.githubusercontent.com/cyb3rdr4g0n17/AndroidIDEInstaller/main/ndk-install.sh | bash

Using wget:

wget -qO- https://raw.githubusercontent.com/cyb3rdr4g0n17/AndroidIDEInstaller/main/ndk-install.sh | bash

Tip

The installer automatically detects your environment, verifies required tools (tar, unzip, xz), locates your Android SDK folder, and applies all necessary toolchain symlinks and CMake host patches.


🛡️ Why This Installer is Needed

Official Google NDK binaries are pre-compiled exclusively for x86_64 host machines (Linux, Windows, macOS). When developing and compiling Android applications directly on an Android device using AndroidIDE, Gradle fails to execute standard NDK binaries because the phone's CPU architecture is aarch64 (ARM64).

This installer bridges that gap by:

  1. Fetching Native ARM64 Builds: Downloads reliable, community-compiled aarch64 NDKs (glibc and lightweight musl binaries) built specifically for Android hosts.
  2. Automating Complex Host-Tag Patches: Official CMake toolchain scripts look for linux-x86_64 host directories. This tool automatically injects host tag overrides (ANDROID_HOST_TAG = linux-aarch64) and configures required prebuilt symlinks.
  3. Resilient Network Engine: Downloads multi-hundred megabyte archives with automatic resume capability, retry loops, and archive checksum/integrity testing.
  4. Selective CMake Ingestion: Rather than forcing every CMake version onto your phone's storage, it allows selective installation of the exact CMake version needed for your Gradle project.

📦 Supported Versions Matrix

Android NDK Releases

NDK Release Revision Code Toolchain Type Host Library Recommended For
r28b 28.1.13356709 Clang / LLVM 19 musl native Latest Stable (Modern AGP 8.x+)
r27c 27.2.12479018 Clang / LLVM 18 musl native High Performance & Stability
r27b 27.1.12297006 Clang / LLVM 18 glibc Standard modern toolchain
r26b 26.1.10909125 Clang / LLVM 17 glibc Stable modern toolchain
r23b 23.2.8568313 Clang / LLVM 12 glibc LTS Recommended for older projects
r21e 21.4.7075529 Clang / LLVM 9 glibc Legacy LTS
r17c – r24 Various GCC / Clang glibc Specialized legacy codebases
r29-beta1 29.0.13113456 Clang / LLVM 20 musl native Cutting-edge preview testing

CMake Versions

  • 3.22.1 (Recommended) — Default version required by modern Android Gradle Plugin (AGP 7.0–8.x).
  • 3.25.1 — For projects utilizing bleeding-edge CMake directives.
  • 3.18.1 & 3.10.2 — For legacy projects and older Gradle setups.

⚙️ Command-Line Options

You can run ndk-install.sh non-interactively in shell scripts or Termux workflows:

# Clone the repository
git clone https://github.com/cyb3rdr4g0n17/AndroidIDEInstaller.git
cd AndroidIDEInstaller
chmod +x ndk-install.sh

# Display help and options
./ndk-install.sh --help

# List all available NDK & CMake versions
./ndk-install.sh --list

# Install specific NDK (r27c) and recommended CMake without prompts
./ndk-install.sh -v r27c -c recommended -y

# Specify a custom Android SDK directory
./ndk-install.sh -v r26b -c 3.22.1 -d /storage/emulated/0/AndroidIDE/android-sdk

Options Reference

Flag Parameter Description
-v, --version <name> Specify NDK version to install (e.g. r27c, r26b, r28b).
-c, --cmake <option> Choose CMake: recommended (3.22.1), modern (3.25.1), all, or none.
-d, --dir <path> Override Android SDK destination path.
-l, --list None Print all supported NDK and CMake versions.
-y, --yes None Automatically accept confirmation prompts.
-h, --help None Display command usage and flags.

🔧 AndroidIDE Configuration

Once the script completes successfully:

  1. Restart AndroidIDE to register the new toolchain paths.
  2. In your project's android/local.properties (or local.properties), ensure your SDK directory matches:
    sdk.dir=/storage/emulated/0/AndroidIDE/android-sdk
    ndk.dir=/storage/emulated/0/AndroidIDE/android-sdk/ndk/27.2.12479018
  3. In your app's build.gradle (or build.gradle.kts), specify the installed NDK version:
    android {
        ndkVersion "27.2.12479018" // Matches installed NDK directory name
        
        externalNativeBuild {
            cmake {
                path "src/main/cpp/CMakeLists.txt"
                version "3.22.1"
            }
        }
    }
  4. Trigger Sync Project with Gradle Files inside AndroidIDE and build your native project.

🔍 Troubleshooting & FAQ

1. "wget: command not found" or "unzip: command not found" The installer automatically attempts to install missing packages using pkg install or apt. If you are in a constrained shell, run:
pkg update && pkg install -y wget curl unzip tar xz-utils
2. "Permission denied" when moving NDK to /storage/emulated/0/ If your SDK is located on shared internal storage, grant storage permissions to your terminal app:
termux-setup-storage
Or run the installation targeting your app's private directory: ~/android-sdk.
3. Which NDK version should I choose? For modern Android development, r27c or r28b (musl native) provides the fastest compilation times and smallest binary footprint on aarch64 devices. If using an older open-source library, r23b or r21e offers maximum backward compatibility.

🙏 Credits & Acknowledgments

  • MrIkso — Original NDK/CMake port builds and foundation script.
  • HomuHomu833 — High-performance musl-based ARM64 NDK toolchain distributions.
  • jzinferno2 — Termux NDK release archives.
  • AndroidIDE Team — For developing a full-featured Android development IDE on Android.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.


About

I help for people who wants to install Android SDK on their phone with the help of AndroidIDE

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages