termux / termux/termux-api

Add accessibility API to interact with other apps

Open
#828 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Feature description

Android API gives the ability to retrieve current structured UI content (where are texts and what are they, where are buttons...) and interact (click, type characters...) with the screen content.

Personal motivation related to Internet-less Wi-Fi required wireless debugging workaround:

This feature would unlock many use cases, notably my open-source voice assistant Benjamin_Loison/Voice_assistant which currently leverages wireless debugging to use adb exec-out uiautomator dump. The issue with wireless debugging is that, despite not using Internet, it requires a Wi-Fi for Termux to connect to the device wireless debugging itself, I planned modifying AOSP to remove this limitation, but I suspect that it is a feature, not a bug in Google's mind and they would not be open to somehow allow proceeding without Wi-Fi. Restricting such possibility to custom ROMs or now on Android versions looks too restrictive for people to enjoy it now.

Personal notes: Benjamin-Loison/android/issues/28

Reference implementation

Have you checked if the feature is accessible through the Android API? Yes, see:

https://developer.android.com/reference/android/view/accessibility/package-summary

Do you know of other open-source apps that has a similar feature as the one you want? (Provide links)

Closed-source apps:

Tasker and AutoInput are closed-source, but leverage this accessibility API to notably retrieve structured screen content. Automate is able to dump the structured screen content as XML.
I just achieved clicking with https://github.com/Nain57/Smart-AutoClicker, but not retrieving structured screen content.

RustDesk is open-source and let the ability through accessibility to click.

I plan to propose a pull request adding commands to leverage accessibility Android API, as my voice assistant is Termux based.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Android's accessibility package summary and the existing Termux API command structure; the issue names no repository files or tests. Define the command surface for retrieving structured UI content and interacting with other apps, then verify that the resulting commands work from Termux.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
api, cli, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.