Termux:API: Exposing Android Hardware to the Shell
Termux add-on app which exposes device functionality as API to command line programs.
At a glance
- What is it?
- Termux:API is the add-on app that lets Termux scripts read sensors, send SMS, take photos and speak text through the termux-api helper binary. Here is what it does, how the socket bridge works, and where it falls short.
- Who is it for?
- Adopt Termux:API if you script Android device functions from Termux and can install both the app and the termux-api package from the same source. Do not adopt it if you need a stable, documented API surface or cannot tolerate the signature-key constraint.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 13 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The gap Termux:API fills between a shell and the hardware
Termux gives you a Linux userland on Android. It does not give you the camera, the SMS stack, the clipboard, the sensors or the text-to-speech engine, because those live behind Android's permission model and are reachable only from an app that holds the relevant permissions. Termux:API is that app. It exposes Android functionality as an API to command line programs, as the repository description puts it, so a shell script can call into device features the same way it calls a local binary. The audience is narrow and specific: people who already run Termux and want their scripts to touch the phone rather than just the filesystem inside it. It is not a general Android automation tool and it is not useful without Termux itself.
How the termux-api helper binary talks to the app
The bridge is a broadcast plus two sockets, and the README is unusually direct about it. The termux-api client binary, which lives in the separate termux-api package, generates two Linux anonymous namespace sockets and passes their addresses to the TermuxApiReceiver broadcast receiver. The README gives the exact shape of that call:
/system/bin/am broadcast ${BROADCAST_RECEIVER} --es socket_input ${INPUT_SOCKET} --es socket_output ${OUTPUT_SOCKET}The receiver picks up the broadcast, and the two sockets carry the payload: stdin from termux-api is forwarded to the relevant API class, and output from that class is written back to termux-api's stdout. That design explains several things a user will notice. It means the API surface is mediated by Android's broadcast mechanism rather than a direct library call. It means the client binary and the app are versioned separately, so mismatches are possible. And it means the app must be allowed to receive those broadcasts, which is why the same signing key requirement exists.
Installing Termux:API and running a first call
The README states that the Termux:API application can be obtained from F-Droid, and that the latest version is v0.53.0. The client scripts that process command line arguments before calling the termux-api helper binary live in the termux-api package, a separate repository. So the install is two parts: the Android app from F-Droid, and the package inside Termux. The README does not give a pkg install line or a first command to try, so the concrete step it does document is the F-Droid listing at https://f-droid.org/en/packages/com.termux.api/, and the pointer to the termux-api package repository for the client scripts. For anyone testing a change, the README also mentions per-commit debug builds obtainable from one of the workflow runs listed on the GitHub Actions page. If the app is missing or the signature keys do not match, calls fail instead of returning data. The README does not document a rollback path, and it does not list every available subcommand; for the full set of client scripts you have to look at the termux-api package repository, which the README links to.
The signing key constraint is the real limitation
The README is explicit: the app needs to be signed with the same key as the main Termux app for permissions to work, because only the main Termux app is allowed to call the API methods in this app. That is a security decision, and a defensible one, but it has consequences. You cannot mix an F-Droid build of Termux with a Play Store build of Termux:API, or vice versa, because the keys differ. The README says that signature keys of all offered builds are different and that before switching installation source you will have to uninstall the Termux application and all currently installed plugins. That is a destructive upgrade path for anyone who has accumulated scripts and data. The second limitation is the debug build channel: per-commit debug builds are offered through GitHub Actions workflow runs for people who want to try the latest features or test a pull request. Those are useful for testing but they are not the release channel, and the README does not present them as such.
Where Termux:API is the wrong tool
If you want to automate Android device functions without a terminal, this is not the project for you. The whole design assumes a shell: the client binary parses command line arguments, the sockets carry stdin and stdout, and the user is expected to compose calls in scripts. An Android automation app with a graphical task builder would be a better fit for that use case. Likewise, if you need a documented, stable API contract, the README here is thin. It explains the transport mechanism well but does not enumerate the API classes or guarantee their behaviour across releases. The separate termux-api package holds the client scripts, so the actual command surface is defined in another repository that this README only links to. And if your device is not rooted and you are not willing to install two signed components from the same source, the permission model will block you before you write a single script.
How it compares to running Android automation from a desktop
The obvious alternative for people who want to drive a phone from a script is adb, the Android Debug Bridge, which runs commands against a device from a host machine over USB or TCP. The difference in approach is architectural. adb requires a host computer, a cable or network connection, and developer options enabled on the device. Termux:API runs entirely on the device, with no host in the loop, and its transport is an in-process broadcast plus anonymous sockets rather than a debug protocol. That makes Termux:API better for scripts that need to run on the phone itself, unattended, and worse for anything that needs a stable remote interface or operates on a fleet of devices. The README's own Ideas section points at further device-level features such as wifi network search and connect, and adding permissions to uninstall or stop apps, which suggests the project sees itself as growing the on-device API surface rather than competing with adb.
Licence and the cost of keeping it current
The README states the project is released under the GPLv3 license. For anyone embedding or redistributing the app, that carries the usual copyleft obligations, and the signature key requirement means a fork cannot simply be dropped in beside the official Termux app. On maintenance: the repository is not archived, and the last push was on 2026-09-17, which is recent. Releases have been coming at a steady clip, with v0.53.0 on 2025-09-01, v0.52.0 on 2025-05-22 and v0.51.0 on 2025-03-29. The upgrade cost is mostly the signature-key dance described above: every time you switch between F-Droid and a debug build, the README says you must uninstall Termux and all plugins. If you stay on one source, upgrades are ordinary app updates. There is no separate configuration file or daemon to manage, which keeps operational overhead low.
Editorial conclusion
Adopt Termux:API if you script Android device functions from Termux and can install both the app and the termux-api package from the same source. Do not adopt it if you need a stable, documented API surface or cannot tolerate the signature-key constraint. Before anything else, verify that the app and the Termux app share a signing key and that the termux-api helper binary is present in your Termux environment.
Frequently asked questions
What does Termux:API do?
It is an app that exposes Android API functionality to command line usage and scripts, so Termux programs can reach device features that a normal Linux userland cannot. The README describes it as an add-on that makes Android APIs callable from the shell.
How do I install Termux:API?
The README says the Termux:API application can be obtained from F-Droid, and the client scripts come from the separate termux-api package. Both parts are needed for calls to work.
How do I install termux-api inside Termux?
The termux-api helper binary and its client scripts live in the termux-api package, which the README links to. The Android app must be installed separately from F-Droid, and the two must share a signing key.
Why is termux api not working?
The README states the app needs to be signed with the same key as the main Termux app for permissions to work, because only the main Termux app is allowed to call the API methods. A key mismatch between an F-Droid build and a Play Store build will break calls.
Is termux api safe?
The README does not make a safety claim, but it does describe a deliberate restriction: only the main Termux app, signed with the same key, is allowed to call the API methods in this app. That limits which apps can reach the exposed device functions.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/termux-termux-api)