[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116215":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},116215,"appine","mthli\u002Fappine","mthli","Run Linux on Android 🤖","https:\u002F\u002Fappine.sh",null,"Rust",257,18,54,5,0,22,128,84,93.77,"GNU Affero General Public License v3.0",false,"master",[25,26],"android","linux","2026-11-23 15:36:17","2026-11-23 16:04:14","# \u003Cimg src=\"website\u002Fdist\u002Ffavicon.svg\" width=\"36\" height=\"36\" align=\"absmiddle\" alt=\"\"> Appine\n\nAppine is a high-performance Linux terminal for Android.\n\nInstall packages, edit code, and build projects on your phone or tablet without rooting it.\n\nAlpine Linux comes bundled with the app. Debian is available from **Settings**.\n\n**[Get Appine on Google Play](https:\u002F\u002Fplay.google.com\u002Fstore\u002Fapps\u002Fdetails?id=io.github.mthli.appine)** · **[Download the APK from GitHub Releases](https:\u002F\u002Fgithub.com\u002Fmthli\u002Fappine\u002Freleases)**\n\nRequires Android 11 or later on a 64-bit ARM device.\n\n## Features\n\n\u003C!-- The 128px dividers give all five columns the same minimum width on narrow screens. -->\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"20%\" align=\"center\" valign=\"top\">\n      \u003Ca href=\"docs\u002Fscreenshots\u002Fcodex-cli.png\">\u003Cimg src=\"docs\u002Fscreenshots\u002Fcodex-cli.png\" width=\"160\" alt=\"Codex CLI open in the Appine project directory\">\u003C\u002Fa>\n      \u003Chr width=\"128\">\n      \u003Cp>Use \u003Cstrong>Codex CLI\u003C\u002Fstrong> to work on a local project from your Android terminal.\u003C\u002Fp>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"20%\" align=\"center\" valign=\"top\">\n      \u003Ca href=\"docs\u002Fscreenshots\u002Fvim.png\">\u003Cimg src=\"docs\u002Fscreenshots\u002Fvim.png\" width=\"160\" alt=\"Vim welcome screen in the second terminal tab\">\u003C\u002Fa>\n      \u003Chr width=\"128\">\n      \u003Cp>Edit code and configuration files in \u003Cstrong>Vim\u003C\u002Fstrong>.\u003C\u002Fp>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"20%\" align=\"center\" valign=\"top\">\n      \u003Ca href=\"docs\u002Fscreenshots\u002Flanguages.png\">\u003Cimg src=\"docs\u002Fscreenshots\u002Flanguages.png\" width=\"160\" alt=\"Version output for Python, Clang, Java, Node.js, Go, and Rust\">\u003C\u002Fa>\n      \u003Chr width=\"128\">\n      \u003Cp>Run Python scripts, compile C and C++, or develop with Java, Node.js, Go, and Rust.\u003C\u002Fp>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"20%\" align=\"center\" valign=\"top\">\n      \u003Ca href=\"docs\u002Fscreenshots\u002Fdocker.png\">\u003Cimg src=\"docs\u002Fscreenshots\u002Fdocker.png\" width=\"160\" alt=\"A running Nginx container serving its welcome page on port 8080\">\u003C\u002Fa>\n      \u003Chr width=\"128\">\n      \u003Cp>Run \u003Cstrong>Docker\u003C\u002Fstrong> containers on your device, for example to host an Nginx web server.\u003C\u002Fp>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"20%\" align=\"center\" valign=\"top\">\n      \u003Ca href=\"docs\u002Fscreenshots\u002Fkitty-graphics.png\">\u003Cimg src=\"docs\u002Fscreenshots\u002Fkitty-graphics.png\" width=\"160\" alt=\"Two landscape photos displayed inline by chafa\">\u003C\u002Fa>\n      \u003Chr width=\"128\">\n      \u003Cp>View images in terminal programs that use the \u003Cstrong>Kitty graphics protocol\u003C\u002Fstrong>.\u003C\u002Fp>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Try Codex CLI\n\n### Alpine Linux (default)\n\n```sh\napk update\napk add nodejs npm\nnpm install -g @openai\u002Fcodex\n```\n\n### Debian\n\n```sh\napt update\napt install nodejs npm\nnpm install -g @openai\u002Fcodex\n```\n\n## How it works\n\nAppine runs unmodified ARM64 Linux binaries inside the Android app process.\nIts CPU engine translates ARM64 instructions into ARM64 code and uses an\ninterpreter for instructions it does not translate. A user-space kernel handles\nLinux system calls, and the Android terminal uses Ghostty's libghostty-vt.\nThe Linux command-line runner uses the same engine and kernel.\n\n## Development\n\n### Build the Android app\n\nInstall JDK 17 or later, Android SDK Platform 37, NDK 29.0.14206865, Rust\nwith rustup, and Zig 0.17.0.\n\nFrom the repository root, fetch the build inputs and install a debug build on a\nconnected ARM64 device or emulator.\n\n```sh\nrustup target add aarch64-linux-android\ncargo install cargo-ndk --locked\nscripts\u002Ffetch-rootfs\nscripts\u002Ffetch-ghostty\ncd android\n.\u002Fgradlew installDebug\n```\n\nRun `.\u002Fgradlew connectedDebugAndroidTest` from the same directory for the\ninstrumentation tests. See the [Android build guide](android\u002FREADME.md#building)\nfor Android Studio setup, release builds, and device tests.\n\n### Develop and test the runtime\n\nThe primary development host is ARM64 Linux. On macOS, start a Docker-compatible\nruntime such as Colima, OrbStack, or Docker Desktop. From the repository root,\n`scripts\u002Fdev` runs each command in the project's ARM64 Linux container.\n\n```sh\nscripts\u002Ffetch-rootfs\nscripts\u002Fdev cargo test --workspace\n```\n\nThe workspace tests cover the kernel, guest programs, and CPU instruction execution.\n\n#### Run a guest program or an Alpine shell\n\nBuild and run the assembly example in `tests\u002Fguest\u002Fhello.S`.\n\n```sh\nscripts\u002Fdev sh -c 'cc -nostdlib -static -no-pie -o \u002Ftmp\u002Fhello tests\u002Fguest\u002Fhello.S &&\n                   cargo run -q -p appine-run -- --tier 1 \u002Ftmp\u002Fhello'\n```\n\nThe C guest programs in `tests\u002Fguest` use `musl-gcc` from the `musl-tools` package.\nThe `scripts\u002Fdev` container includes it. If the compiler is missing, the test\nsuite skips the tests that need it.\n\nTo run BusyBox, import the Alpine minirootfs tarball. Without the tarball,\n`cargo test` skips the rootfs tests.\n\n```sh\nscripts\u002Ffetch-rootfs # downloads and verifies target\u002Frootfs\u002Falpine-minirootfs-*.tar.gz\nscripts\u002Fdev sh -c 'cargo build -q -p appine-run && run=target\u002Flinux-arm64\u002Fdebug\u002Fappine-run &&\n                   $run --rootfs target\u002Fstore --import target\u002Frootfs\u002Falpine-minirootfs-*.tar.gz &&\n                   $run --rootfs target\u002Fstore \u002Fbin\u002Fbusybox ls -l \u002F &&\n                   $run --rootfs target\u002Fstore --env PATH=\u002Fbin:\u002Fusr\u002Fbin \u002Fbin\u002Fsh -c \"ls \u002F | wc -l\"'\n```\n\nWhen stdin and stdout are connected to a terminal, `appine-run` gives the guest\nan in-process terminal. The interactive login shell below supports job control\n(`Ctrl-C`, `Ctrl-Z`, and `fg`) and full-screen programs such as `vi` and `top`.\n\n```sh\nscripts\u002Fdev target\u002Flinux-arm64\u002Fdebug\u002Fappine-run --rootfs target\u002Fstore \\\n    --env TERM=xterm-256color --env HOME=\u002Froot \u002Fbin\u002Fsh -l\n```\n\nThe guest uses the host's network, so `apk` and `git` work. The guest only sees the\nenvironment variables passed with `--env`. If the host needs a proxy, pass its\nsettings to the guest.\n\n```sh\nscripts\u002Fdev sh -c 'target\u002Flinux-arm64\u002Fdebug\u002Fappine-run --rootfs target\u002Fstore \\\n    --env PATH=\u002Fusr\u002Fsbin:\u002Fusr\u002Fbin:\u002Fsbin:\u002Fbin --env HOME=\u002Froot \\\n    --env http_proxy=$http_proxy --env https_proxy=$https_proxy \\\n    \u002Fbin\u002Fsh -c \"apk update && apk add git python3\"'\n```\n\nThe tests that need the internet run only with `APPINE_NETWORK_TESTS=1`.\n\n#### Run Linux Test Project syscall tests\n\nBuild the [Linux Test Project](https:\u002F\u002Fgithub.com\u002Flinux-test-project\u002Fltp) syscall\ntests in an ARM64 Alpine container. The test runner starts a fresh `appine-run`\nprocess for each test.\n\n```sh\nscripts\u002Fdev cargo build --release -p appine-run\nscripts\u002Fbuild-ltp                        # builds target\u002Fltp\u002Fltp-\u003Cversion>.tar (needs Docker)\nscripts\u002Fdev scripts\u002Fltp -j 8             # all syscall tests; results in target\u002Fltp\u002Fresults.txt\nscripts\u002Fdev scripts\u002Fltp 'fcntl.*|mmap.*' # only the tests whose name matches\n```\n\n#### Compare Appine with native Linux\n\n`scripts\u002Fdifftest` runs each script in `tests\u002Fdiff` in both Appine and a native\nARM64 Docker container, then compares the output and exit status. The container\nruns without Docker's seccomp profile because the profile changes what some\nsyscalls return, including `clone3` and `pidfd_getfd`.\n\nRun these commands on the host. On macOS, `scripts\u002Fdifftest` calls `scripts\u002Fdev`\nitself.\n\n```sh\nscripts\u002Ffetch-rootfs\nscripts\u002Fdev cargo build --release -p appine-run\nscripts\u002Fdifftest              # all cases on tier 1\nscripts\u002Fdifftest -t 0 signals # one case on the interpreter\n```\n\nThe first run needs internet access. It creates a store in `target\u002Fdifftest\u002Fstore`\nfrom the minirootfs and installs Python 3, GCC, Lua, SQLite, Go, Node.js,\nOpenJDK 21, strace, and GDB with `apk`. It exports the root filesystem from\nAppine and imports it as a Docker image so both sides use the same files.\n\nIf an older store lacks a package, install it in the store with `apk add` or\ndelete the store to rebuild it. In either case, pass `-r` to `scripts\u002Fdifftest`\nto export the filesystem again.\n\n#### Benchmark, trace, and profile the runtime\n\nFor a longer lockstep comparison, run `appine-lockstep`. To compare\nthe interpreter and binary translator against native execution, run `appine-bench`.\n\n```sh\nscripts\u002Fdev cargo run --release -p appine-lockstep -- --iterations 1000000\nscripts\u002Fdev sh -c 'cargo build --release -p appine-run -p appine-bench &&\n                   target\u002Flinux-arm64\u002Frelease\u002Fappine-bench'\n```\n\nTo debug a failing test, rerun it with `APPINE_STRACE=1`. `appine-run` prints each syscall\nwith its arguments and result, so you can check which calls failed or returned unexpected\nvalues.\n\nTo profile the runtime, run `appine-run` under `perf record` with `APPINE_PERF_MAP=1`.\nTier 1 writes `\u002Ftmp\u002Fperf-\u003Cpid>.map` so `perf report` can attribute samples in\ntranslated code to guest addresses (`g_\u003Cpc>`).\n\nPass `--stats` to see how many blocks the translator compiled and why translated\ncode exited. `tier 0 fallback` counts instructions the translator leaves to the interpreter.\nThe `interp` count on the `exits` line records each runtime exit to the interpreter,\nincluding exits caused by failed grouped memory checks.\n\n#### Runtime failures and memory limits\n\nIn release builds, if the kernel or engine panics or the engine faults on host\nmemory, Appine kills only the affected guest process and reports the bug on\nstderr. A panic in a `Machine` method called by the host fails only that call.\n\nDebug builds abort `appine-run` so you can inspect the bug where it happened.\nSet `APPINE_ON_BUG=kill` or `APPINE_ON_BUG=abort` to override the default.\n\nIf Appine's anonymous memory exceeds `--memory-limit` (half the RAM by default),\nAppine sends `SIGKILL` to the guest process using the most memory, like the Linux\nOOM killer.\n\n## Project documentation\n\n- [Architecture overview](docs\u002Fdesign\u002FREADME.md#3-overall-architecture) and\n  [module index](.agents\u002FMODULES.md) for navigating the source.\n- [Module maps](.agents\u002Fmaps) for current behavior and tests, and\n  [design decisions](.agents\u002Fdecisions) for the reasoning behind changes.\n- [Development milestones](docs\u002Fmilestones.md) for earlier measurements and implementation history.\n- Coding agents should start with [AGENTS.md](AGENTS.md).\n\n## License\n\nCopyright (C) 2026 Matthew Lee.\n\nAppine is licensed under the [GNU Affero General Public License, version 3 or later](LICENSE).\n\nParts of the terminal line discipline in `core\u002Fkernel\u002Fsrc\u002Ftty.rs` are adapted\nfrom Fuchsia's Starnix and retain [The Fuchsia Authors' BSD-style license](android\u002Flicenses\u002Ffuchsia-LICENSE).\n\nThe app includes separate notices for libghostty-vt and its dependencies,\nJetBrains Mono, Alpine Linux packages, Android libraries, and Rust crates.\nRead them in **Settings → Open source licenses** or browse the\n[bundled notices](android\u002Fapp\u002Fsrc\u002Fmain\u002Fassets\u002Fnotices).\n","Appine 是一款在 Android 设备上无需 Root 即可运行原生 Linux 环境的终端应用。它基于 Rust 实现，内置 Alpine Linux（默认）与可选 Debian 发行版，支持包管理（apk\u002Fapt）、多语言开发（Python\u002FGo\u002FRust\u002FNode.js 等）、Vim 编辑、Docker 容器运行及 Kitty 图形协议图像渲染。其核心采用指令翻译+解释混合执行引擎，在用户态模拟 Linux 内核系统调用，兼容未修改的 ARM64 Linux 二进制程序。适用于移动场景下的轻量开发、脚本调试、学习 Linux 命令行或离线技术实验。",2,"2026-11-24 04:53:11","CREATED_QUERY"]