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).
Download the latest APK · Website · Report a bug · Telegram
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.
| 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.
- 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
ptracesystem 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_watchauto-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
FINDto 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
/sdcarddevice storage integration and standard background service controls viaservice,/etc/init.d/, and/etc/cortex/autostart.
+-----------------------------------------------------------+
| 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)| |
| +-----------------------------------------------------+ |
+-----------------------------------------------------------+
- 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.
- Userspace Redirection (
libcortex-hook.so): Using an ultra-lightweight dynamic linker hook injected viaLD_PRELOAD, standard Linux filesystem paths (/usr,/bin,/etc,/tmp) are transparently redirected to Cortex's private application space without slow operating system-level traps. - 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.
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.soCortex 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/bashis exported, so installers such asnvm,bun,rustup,pnpmandopencodeappend theirPATHsetup to~/.bashrcexactly like on Ubuntu.- Automatic reload: when an installer (or you) changes
~/.bashrc,~/.profileor~/.bash_profile, the running shell re-sources it at the next prompt, sonvm,opencodeand friends work immediately without restarting the terminal. Runreloadto do it by hand, orexport 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'suser@host:dir$prompt.
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/neovimclipboard providers andsshsessions 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
tmuxthe marks are swallowed bytmuxitself. Opt out in the shell withexport CORTEX_COMMAND_MARKS=0. - Hyperlinks (OSC 8): output such as
ls --hyperlink=autoorgccdiagnostics is underlined and tapping it copies the target. Plainhttps://text is detected as before.
The prompt hooks are added to
PROMPT_COMMANDat login. If your~/.bashrcreplacesPROMPT_COMMANDinstead of appending to it (PROMPT_COMMAND="...;$PROMPT_COMMAND"), automatic reload and the marks are lost.
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.
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.
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.
- Navigate to the Releases section of this repository.
- 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.
- Optional, before installing: verify the download as described in
signing/README.md(theV3.1 Signermust be the published current key). - Install the APK and grant storage permissions when prompted.
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.
Cortex is developed in the maintainer's spare time, mostly on weekends, so answers to feature requests and bug reports can take a while.
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.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for full details.

