Skip to content
ssfuisuPublic

About

Cortex Terminal: run real Ubuntu 24.04 LTS (glibc 2.39, apt) natively on Android. No root, no PRoot, no containers, no VM. A fast Termux alternative for arm64 and armv7, with 50 languages.

Topics

Resources

Stars

18 stars

Watchers

2 watching

Forks

Repository files navigation

Cortex Terminal: Ubuntu 24.04 on Android, natively

Run real Ubuntu 24.04 LTS (glibc 2.39, apt) directly on your Android phone or tablet: no root, no PRoot, no containers, no virtual machine. Cortex is a free and open-source terminal app and a native alternative to Termux + proot-distro for people who want genuine Ubuntu packages on Android (arm64 and armv7).

Release Downloads Stars Telegram License

Download the latest APK · Website · Report a bug · Telegram

neofetch in Cortex Terminal showing Ubuntu 24.04 LTS running natively on an Android phone Cortex Terminal virtual keyboard toolbar with ESC, TAB, CTRL, ALT and arrow keys

What is Cortex?

Cortex is a next-generation native Linux terminal and development powerhouse engineered for Android.
It delivers an authentic Ubuntu 24.04 LTS (Noble Numbat) environment powered by GNU C Library (Glibc 2.39) on unrooted devices.
Unlike existing solutions, Cortex operates with ZERO virtualization, ZERO PRoot, and ZERO containers.
All command-line utilities, compilers, and runtimes execute directly on your physical CPU cores and the Android Linux kernel.
With full APT package management, high-speed developer launchers, and a modern Material 3 interface, Cortex turns your Android device into a complete coding workstation.


Why Cortex?

Cortex Termux (its own packages) Termux + proot-distro Android Linux Terminal (VM)
Needs root No No No No
How Linux programs run Directly on the Android kernel; a small LD_PRELOAD library maps /usr, /etc, ... into the app's private storage Directly, as programs built for Android Inside PRoot, a user-space chroot that intercepts system calls with ptrace Inside a virtual machine (Android Virtualization Framework, supported devices only)
C library glibc 2.39 (Ubuntu) Bionic (Android's libc) glibc of the chosen distribution glibc (Debian)
Package source Ubuntu 24.04 archive via apt Termux repositories via pkg The distribution's own apt Debian apt
Cost of running programs No ptrace. The library adds 0.04 to 0.4 µs to most file-path calls (1.3 µs to lstat() of a symbolic link) and about 0.3 ms to starting a program (details) None ptrace stops on every system call Virtualization overhead

Pick Cortex when you need Ubuntu's own .deb packages and a genuine glibc without the layers PRoot or a VM add. Termux remains a great choice for its large, Android-specific package set.


Features

  • Genuine Ubuntu 24.04 LTS & Glibc 2.39: Run standard GNU/Linux software, compilers, and modern libraries without Android Bionic libc limitations or missing header errors.
  • Native Execution: No PRoot ptrace system call traps, no chroot, and no QEMU/KVM emulation. Code runs on the phone's CPU at full speed; the small preloaded library adds a few percent to calls that take a file path (see Performance).
  • Full Debian/Ubuntu APT Package Manager: Complete, zero-warning package installation (apt update, apt install) verified with official Ubuntu archive GPG keyrings and dynamic DNS.
  • Full OpenJDK 17 JDK & JRE Runtime: Out-of-the-box Java 17 development support (apt install openjdk-17-jdk) with dynamic linker library path preservation and POSIX shared memory (/dev/shm).
  • High-Speed AI & Developer Launchers: One-command instant CDN setups for OpenCode, Meta Muse Code, and Google Antigravity.
  • Bun & Node.js Crash Prevention: Transparent inotify_add_watch auto-provisioning ensures Bun-based tools like OpenCode never crash due to missing configuration directories.
  • Modern Material 3 Terminal Interface: Sleek dark UI, high-framerate font rendering, full 256-color & 24-bit TrueColor support, and JetBrains Mono monospace typography.
  • 2-Row Virtual Keyboard Toolbar: Quick-access tactile keys for ESC, TAB, CTRL, ALT, arrow navigation, pipes (|), brackets, and symbol combinations.
  • Integrated Terminal Search: Swipe across the keyboard toolbar or tap FIND to search through 5,000 lines of scrollback buffer with real-time match counts and navigation.
  • Clickable Links & Clipboard Image Insertion: Underlined URLs and OSC 8 hyperlinks are copied to the clipboard when tapped; tapping images in your keyboard clipboard automatically saves and types their file path.
  • Multi-Session Management: Seamlessly spawn, switch between, and manage multiple active terminal sessions from the left navigation drawer.
  • Full Storage & Background Services: Deep /sdcard device storage integration and standard background service controls via service, /etc/init.d/, and /etc/cortex/autostart.

How It Works

+-----------------------------------------------------------+
|                      Cortex Terminal                      |
|                                                           |
|  +-----------------------------------------------------+  |
|  | Modern Material 3 UI (Sessions, Search, Keys Bar)   |  |
|  +-----------------------------------------------------+  |
|                            |                              |
|  +-----------------------------------------------------+  |
|  | Native PTY Controller (Direct Unix Terminal Bridge) |  |
|  +-----------------------------------------------------+  |
|                            |                              |
|  +-----------------------------------------------------+  |
|  | Userspace Hook (libcortex-hook.so, no ptrace)       |  |
|  +-----------------------------------------------------+  |
|                            |                              |
|  +-----------------------------------------------------+  |
|  | Android Linux Kernel (Direct Hardware CPU Execution)|  |
|  +-----------------------------------------------------+  |
+-----------------------------------------------------------+
  1. Direct Kernel Execution: Cortex does not run inside a virtual machine or container. Programs execute directly on your device's real ARM64 / ARMv7 hardware threads using Android's native Linux kernel.
  2. Userspace Redirection (libcortex-hook.so): Using an ultra-lightweight dynamic linker hook injected via LD_PRELOAD, standard Linux filesystem paths (/usr, /bin, /etc, /tmp) are transparently redirected to Cortex's private application space without slow operating system-level traps.
  3. No Root Required: All path mapping, permission polyfills, and simulated root privileges (getuid / geteuid) happen strictly in userspace, allowing full development capabilities on any unrooted Android device.

Performance

Cortex runs programs directly on the phone's CPU, so work that does not call the kernel (compilers, interpreters, compression, your own code) runs at native speed. The preloaded library libcortex-hook.so adds a small cost in two places: on calls that take a file path, because the path has to be mapped into Cortex's storage, and when a program is started.

Measured on one 8-core Android phone (Linux 4.14, one big core, median of 9 interleaved runs). "Added" is the time the library adds to one call, compared with the same call on a real path without the library:

Call Cortex 1.26.29 this release
stat() of a file +260 ns (+18%) +39 ns (+3%)
open + read + close +277 ns (+10%) +226 ns (+8%)
fopen + fclose +390 ns (+12%) +82 ns (+2%)
readlink() +269 ns (+22%) +179 ns (+14%)
opendir + readdir + closedir +600 ns (+10%) +426 ns (+7%)
stat() of a command that is not in /usr/bin (what a shell does when it searches PATH) +1,867 ns (+141%) +107 ns (+8%)
lstat() of a symbolic link +1,526 ns (+113%) +1,306 ns (+97%)
write(), dup() + close(), getcwd(), sigprocmask() up to +21 ns up to +21 ns
Computation without system calls 0 0

lstat() of a symbolic link stays expensive because the library reads the link to report its size the way Ubuntu does.

Starting a program (what a shell does for every command): the library made 19 system calls before the program started and now makes 7, no longer changes the permissions of ld.so each time, and lists the library directories that hold nearly every library first, so a program no longer pays two failed lookups per library (apt-cache made 34 of them, bash 4, now none). Starting a program through the library takes 769 µs instead of 903 µs; starting ld.so by hand without the library takes 491 µs.

Whole commands (find, ls -lR, dpkg, tar, grep -r, compiling a C file, reinstalling 36 packages) differ from the previous version by less than the up to ±10% variation of the phone from run to run, with two exceptions that held in two separately designed measurements: ls -lR is about 20% faster (it no longer prints an error line for every symbolic link) and a shell that starts a program a hundred times is 5 to 14% faster. The library was a small part of the other commands to begin with. Numbers differ from phone to phone, so compare builds on the same device.

To measure your own device (inside Cortex, with a C compiler installed):

tests/bench/run-micro.sh                      # the installed library against no library
tests/bench/run-micro.sh old=/tmp/hook-old.so new=$CORTEX_ROOT/usr/lib/libcortex-hook.so

Shell Environment (Ubuntu 24.04 compatible)

Cortex starts a standard bash login shell and follows Ubuntu's startup order, so installers behave as they do on a real Ubuntu machine:

File Owner Purpose
/etc/profile, /etc/bash.bashrc Ubuntu stock system-wide startup
/etc/profile.d/00-env.sh, 01cortex.sh, 02-cortex-shell.sh Cortex (rewritten on every app start) CORTEX_ROOT, LD_PRELOAD, de-duplicated PATH, APT/CA/timezone settings, reload
~/.profile, ~/.bashrc You created once from /etc/skel; Cortex never rewrites them again
  • SHELL=/bin/bash is exported, so installers such as nvm, bun, rustup, pnpm and opencode append their PATH setup to ~/.bashrc exactly like on Ubuntu.
  • Automatic reload: when an installer (or you) changes ~/.bashrc, ~/.profile or ~/.bash_profile, the running shell re-sources it at the next prompt, so nvm, opencode and friends work immediately without restarting the terminal. Run reload to do it by hand, or export CORTEX_AUTO_RELOAD=0 (e.g. in ~/.bashrc) to disable it.
  • Cortex keeps its compact \w $ prompt via one line at the end of a new ~/.bashrc; delete that line to get Ubuntu's user@host:dir$ prompt.

Terminal Integration

Programs talk to the Android side through standard terminal escape sequences, so there are no extra sockets, services or permissions to set up:

  • Clipboard (OSC 52): tmux (set -g set-clipboard on), vim/neovim clipboard providers and ssh sessions can copy text to the Android clipboard. Only writing is supported; programs can never read your clipboard. Switch it off under Settings > Notifications & Clipboard.
  • Long command notifications (OSC 133): the shell reports when each command starts and ends. If a command that ran longer than the limit (15 s / 30 s / 1 min / 5 min, default 30 s) finishes while Cortex is in the background, you get a notification with the exit status. Inside tmux the marks are swallowed by tmux itself. Opt out in the shell with export CORTEX_COMMAND_MARKS=0.
  • Hyperlinks (OSC 8): output such as ls --hyperlink=auto or gcc diagnostics is underlined and tapping it copies the target. Plain https:// text is detected as before.

The prompt hooks are added to PROMPT_COMMAND at login. If your ~/.bashrc replaces PROMPT_COMMAND instead of appending to it (PROMPT_COMMAND="...;$PROMPT_COMMAND"), automatic reload and the marks are lost.

Backup and Restore

cortex-backup                  # saves ~/ and /root to /sdcard/Download/cortex-backup-<date>.tar.gz
cortex-backup restore FILE     # puts them back (asks first; --yes skips the question)
cortex-backup list             # shows existing backups

Caches (~/.cache, ~/.npm/_cacache) and the ~/storage link are skipped (--include-caches keeps them). Archives that contain anything outside home/ and root/ are refused. Installed packages are not part of a backup: reinstall them with apt after restoring on a fresh install.

Files App Integration

The Cortex home directory shows up as Cortex in Android's Files app and in every file picker, so you can open, share, create, rename and delete files without copying them to shared storage first. Only the home directory is exposed (never the Ubuntu system tree), links that point outside it such as ~/storage stay hidden, and other apps can only reach files you pick yourself. Turn it off under Settings > Files.

Languages

The interface follows the system language and can be switched under Settings > Language. Available: English, Arabic, Azerbaijani, Bengali, Bulgarian, Catalan, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, Filipino, Finnish, French, German, Greek, Gujarati, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Kannada, Kazakh, Korean, Malay, Malayalam, Marathi, Nepali, Norwegian Bokmål, Persian, Polish, Portuguese (Brazil), Punjabi, Romanian, Russian, Serbian, Slovak, Spanish, Swahili, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu and Vietnamese. On Android 13+ the language can also be set per app in the system settings.

The translations were produced with machine assistance and have not all been reviewed by native speakers. Corrections are welcome: every language lives in app/src/main/res/values-<code>/strings.xml, and python3 scripts/check-translations.py verifies that a language is complete and that its placeholders match English.


How to Install

  1. Navigate to the Releases section of this repository.
  2. Download the APK corresponding to your device architecture:
    • Cortex-arm64-v8a-signed.apk: For all modern 64-bit Android smartphones and tablets (recommended).
    • Cortex-armeabi-v7a-signed.apk: For legacy 32-bit Android devices.
  3. Optional, before installing: verify the download as described in signing/README.md (the V3.1 Signer must be the published current key).
  4. Install the APK and grant storage permissions when prompted.

FAQ

Does Cortex need root? No. It runs on unrooted devices.

Does it use PRoot, chroot or a virtual machine? No. Programs run directly on the Android kernel. A small preloaded library redirects file paths such as /usr and /etc to Cortex's private storage and emulates root-only details like the user id.

Which Android versions and CPUs are supported? Android 7.0 and newer. There are two APKs: Cortex-arm64-v8a-signed.apk for 64-bit devices (almost all current phones) and Cortex-armeabi-v7a-signed.apk for 32-bit ARM.

How do I install software? Use apt like on any Ubuntu system, for example apt update && apt install git python3 build-essential openjdk-17-jdk. Installers such as nvm also work, and a changed ~/.bashrc is picked up at the next prompt.

Is there a desktop or GUI? Not yet. Cortex is a terminal; there is no X11 or Wayland server.

Will every Ubuntu package work? Most command-line tools do. Packages that depend on kernel features Android does not allow for apps (for example systemd services or privileged device access) cannot work.

Can I compile C and C++ programs? Yes. apt install build-essential installs gcc, g++ and make, and the C library headers and libraries (libc6-dev, linux-libc-dev) come with the app, so -dev packages such as zlib1g-dev or python3-dev install too. Two limits: statically linked programs (gcc -static) are killed at start by Android's seccomp filter, so link dynamically; and Cortex keeps the C library itself (libc6, libc-bin) at the version it ships, because Ubuntu's own build does not start under Android's filter, so apt upgrade leaves those packages alone.

How do I back up my files? Run cortex-backup. See Backup and Restore.

How do I update? The app checks the releases page and offers to install new versions.

Where do I report problems or ask questions? On GitHub Issues or on Telegram.


Project status

Cortex is developed in the maintainer's spare time, mostly on weekends, so answers to feature requests and bug reports can take a while.


Community & Support

Have feedback, questions, or ideas for new features? We'd love to hear from you:

  • GitHub Issues: Open a bug report or feature request on GitHub Issues.
  • Telegram: Chat directly with the developer on Telegram: @ratzgn.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for full details.

About

Cortex Terminal: run real Ubuntu 24.04 LTS (glibc 2.39, apt) natively on Android. No root, no PRoot, no containers, no VM. A fast Termux alternative for arm64 and armv7, with 50 languages.

Topics

Resources

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages