Important Termux documentation and resources
masterThe following resources are useful for understanding Termux usage, file systems, and terminal behavior:
repository·master·Indexed 13 days ago
https://github.com/termux/termux-appAn Android terminal emulator and Linux environment that allows running a full Linux distribution without root access. Includes documentation on installation via F-Droid, GitHub, and Google Play, plugin integration (API, Boot, Float, Styling, Tasker, Widget), debugging with logcat, and executing commands from third-party apps via the RunCommandService.
The following resources are useful for understanding Termux usage, file systems, and terminal behavior:
The core Termux application provides the terminal emulation and user interface. To extend its functionality, you can install optional plugin apps. Each plugin adds specific capabilities to the Termux environment:
Termux and its plugins share the same sharedUserId (com.termux). Consequently, all APKs (the main app and any plugins) must be signed with the same key to work together.
Do not mix sources (e.g., installing the app from F-Droid and a plugin from GitHub). Mixing sources will result in installation errors such as:
App not installedFailed to install due to an unknown errorINSTALL_FAILED_UPDATE_INCOMPATIBLEINSTALL_FAILED_SHARED_USER_INCOMPATIBLEsignatures do not match previously installed versionIf you need to switch sources, you must uninstall all existing Termux apps and plugins before installing the new ones from the chosen source. It is recommended to Back up Termux before doing so.
Termux can be installed through several channels. Note that this repository contains the application (UI and terminal emulation), while the Linux packages installed within the environment are managed by the termux-packages repository.
Available installation methods:
A build of Termux is available on Google Play for Android 11+ devices.
Warning: This is an experimental branch with missing functionality and bugs compared to the stable F-Droid or GitHub builds. It is built from a separate repository (termux-play-store).
Managing Updates:
Google Play may attempt to update existing F-Droid installations, which will fail due to sharedUserId differences. To prevent failed update attempts, go to the Termux app page in the Play Store, tap the three-dot menu, and disable Enable auto update.
Termux can be obtained from GitHub via GitHub Releases or GitHub Build Action workflows.
Selection Guide:
apt-android-7 variants.apt-android-5 variants.Sources:
Assets dropdown of a release. These are stable versions.Artifacts section of a workflow run. These are bleeding-edge builds from recent commits. You must be logged into a GitHub account to download artifacts.Security Warning: GitHub APKs are signed with a shared test key. Do not install Termux GitHub builds distributed via unofficial channels like Telegram, as they could be malicious.
https://github.com/termux/termux-app/releasesTo completely remove Termux from your device or to switch to a different installation source, you must uninstall all related APKs.
Android Settings -> Applications.termux in the application list.Termux can be installed from F-Droid. You do not need to install the F-Droid app itself; you can download the Termux APK directly from the F-Droid website.
Important Notes:
Updates tab.https://f-droid.org/en/packages/com.termux/If you are reporting an issue, you can automatically generate a report containing stat info and a logcat dump:
More -> Report Issue.YES when prompted to add debug info.If the generated report is too large, you can use the Save To File option in the context menu (three dots on the top right) of the ReportActivity to manually save and share the file.
Important: When reporting issues, always provide the complete text report. Submitting only screenshots of error reports will likely result in the issue being closed or deleted.
The ResultConfig class is used to define how the results of a shell command should be delivered to a consumer. Results can be delivered in two primary ways:
PendingIntent: The results are sent back to a specific package using an Android PendingIntent. You must specify the keys used to retrieve specific data (like stdout, stderr, or exitCode) from the resulting android.os.Bundle.Use isCommandWithPendingResult() to check if the configuration specifies either a PendingIntent or a resultDirectoryPath.
The Termux shell environment is a layered configuration that builds upon the standard Android shell environment. It includes:
HOME: Set to the Termux home directory.PREFIX: Set to the Termux prefix directory.TMPDIR: Set to the Termux temporary directory (unless in isFailSafe mode).Path and Library Behavior:
PATH is set to the Termux bin prefix directory, and LD_LIBRARY_PATH is removed by default to rely on DT_RUNPATH for binary dependencies.PATH includes both the Termux bin prefix and an /applets directory (for BusyBox), and LD_LIBRARY_PATH is set to the Termux lib prefix directory.The TermuxService manages the connection between the terminal sessions and the UI (the TermuxActivity). This is handled via a TermuxTerminalSessionClient.
setTermuxTerminalSessionClient(TermuxTerminalSessionActivityClient) to provide a fully implemented client that allows the UI to interact with terminal sessions. This updates all existing sessions via updateTerminalSessionClient.unsetTermuxTerminalSessionClient() to clear activity references, preventing memory leaks. It reverts sessions to a fallback TermuxTerminalSessionServiceClient.getTermuxTerminalSessionClient() to get the current client. It returns the TermuxTerminalSessionActivityClient if the activity is bound, otherwise it returns the fallback TermuxTerminalSessionServiceClient.