Termux is not an isolated app — it registers several Android system entry points that allow other apps to share files with it, let file managers browse its filesystem, and let it survive in the background as a long-running Linux environment. Understanding these integration points helps you make the most of Termux on modern Android versions and diagnose unexpected behaviour from the OS.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/termux/termux-app/llms.txt
Use this file to discover all available pages before exploring further.
File sharing integration
Termux registers twoactivity-alias entries in its AndroidManifest.xml that make it appear in Android’s share sheet and file-viewer choosers.
Receiving shared files (FileShareReceiverActivity)
com.termux.app.api.file.FileShareReceiverActivity handles android.intent.action.SEND intents. It accepts the following MIME types:
application/*audio/*image/*message/*multipart/*text/*video/*
content:// URI pointing at the file. Termux prompts for a filename and saves the file to ~/downloads/ inside its private storage. It then opens a terminal session in that directory so you can process it with standard command-line tools. If ~/bin/termux-file-editor exists and is executable, Termux invokes it with the received file path as the argument instead.
Opening/viewing files (FileViewReceiverActivity)
com.termux.app.api.file.FileViewReceiverActivity handles android.intent.action.VIEW intents with the same broad set of MIME types (excluding message/* and multipart/*). This lets Termux appear in the “Open with…” chooser for most file types, enabling you to open a file directly in the terminal.
Disabling receivers
Both receivers can be disabled viatermux.properties:
~/.termux/termux.properties (primary) or ~/.config/termux/termux.properties (secondary).
DocumentsProvider
Termux registers aDocumentsProvider with authority com.termux.documents:
MANAGE_DOCUMENTS permission — such as system file managers and backup tools — can use this provider to browse Termux’s home directory ($HOME) and prefix directory ($PREFIX) without requiring root. The provider surfaces these directories as a standard Android document tree, which means users can navigate them through the Android system file picker and grant other apps access to specific files.
The DocumentsProvider is separate from the file-sharing
ContentProvider (com.termux.files), which is protected by com.termux.permission.RUN_COMMAND and used internally by the RUN_COMMAND API for URI-based file access.Android permissions
Termux requests the following permissions. Understanding each one helps with troubleshooting and explains why certain prompts appear on first launch.Networking
Networking
INTERNET— Required for package management (apt/pkg), SSH, curl, and any network-using package.ACCESS_NETWORK_STATE— Lets Termux check connectivity before network operations.
Storage
Storage
READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE— Legacy storage access used on Android < 10.MANAGE_EXTERNAL_STORAGE— Broad filesystem access on Android 11+, required to access paths outside/sdcard/Android/data/com.termux. Prompted when you runtermux-setup-storage.REQUEST_INSTALL_PACKAGES— Allows installing APKs from within Termux.
Background execution
Background execution
WAKE_LOCK— Keeps the CPU awake during long-running terminal sessions or background commands.FOREGROUND_SERVICE— Required to runTermuxServiceas a foreground service with a persistent notification, keeping the process alive.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS— Lets Termux ask Android to exclude it from battery-saving process killing. Granting this is important for reliable background operation (see Android 12+ considerations).RECEIVE_BOOT_COMPLETED— AllowsSystemEventReceiverto receiveBOOT_COMPLETEDbroadcasts, which is required by the Termux:Boot plugin to run startup scripts.
UI and display
UI and display
SYSTEM_ALERT_WINDOW— Draws the floating overlay window used by Termux:Float.VIBRATE— Provides haptic feedback for the extra keys bar.
Diagnostics (signature/privileged)
Diagnostics (signature/privileged)
READ_LOGS— Reads system logcat output. Requires ADB grant on non-rooted devices.DUMP— Dumps system service state. Requires ADB grant.WRITE_SECURE_SETTINGS— Modifies secure system settings. Requires ADB grant.PACKAGE_USAGE_STATS— Reads app usage statistics.
Android 12+ considerations
This affects any long-running background commands or servers you start from Termux. Mitigation steps:Disable battery optimisation for Termux
Go to Android Settings → Apps → Termux → Battery and select Unrestricted (or Don’t optimise, depending on your device). This is the most effective step for keeping Termux alive in the background.Alternatively, open Termux and run:
Keep TermuxService in foreground
The Termux notification (from
TermuxService) must remain visible. Do not dismiss it or kill the app from the recents screen — doing so terminates all running sessions.Android 12L / 13 and later
An option to disable phantom process trimming became available in Android 12L and Android 13 via developer options or ADB (
device_config flags). Check the upstream issue #2366 for the latest guidance.Samsung DeX support
Termux includes metadata entries that opt it into Samsung’s multi-display and DeX features:| Metadata key | Value | Effect |
|---|---|---|
com.samsung.android.keepalive.density | true | DeX Mode and Screen Mirroring support (DeX < 3.0) |
com.samsung.android.multidisplay.keep_process_alive | true | DeX Dual Mode support (DeX ≥ 3.0) |
com.sec.android.support.multiwindow | true | Samsung multi-window support |
android.max_aspect | 10.0 | Allows full-screen on ultra-wide displays (required for Samsung Galaxy S8+) |
TermuxActivity is also declared with android:resizeableActivity="true", enabling split-screen and freeform window modes on supported Android versions.
Shared user ID
All Termux plugin APKs (com.termux, com.termux.api, com.termux.boot, com.termux.window, com.termux.styling, com.termux.tasker, com.termux.widget) share the android:sharedUserId value com.termux. This means:
- All apps run under the same Linux UID and can read each other’s files.
- All APKs installed on a device must be signed with the same key. Mixing APKs from different sources (F-Droid, GitHub, Google Play) will cause
INSTALL_FAILED_SHARED_USER_INCOMPATIBLEerrors.