Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: List and launch apps #380

Open
zachdecook opened this issue Oct 20, 2020 · 1 comment
Open

Feature request: List and launch apps #380

zachdecook opened this issue Oct 20, 2020 · 1 comment

Comments

@zachdecook
Copy link

Currently, certain apps can be opened by opening a URL (e.g. open gemini:// or open mailto:). Also apps can be "opened" by sharing a file to them.

Is there a generic way for termux to launch apps outright?

It also would be nice to be able to list apps (to make an interactive terminal application with acts as an app launcher).

@xalexalex
Copy link
Contributor

xalexalex commented Oct 21, 2020

I'd looked into this several months ago and have a few snippets lying around.
You can launch an activity with am start --user 0 "$x" &>/dev/null, and you can get the list of activities you can use in place of $x with

adb shell pm list packages | cut -d: -f2 | \
while read -r pkg; do
	adb shell "cmd package resolve-activity --brief $pkg | tail -n1" </dev/null | grep '/'
done | sort

example: am start --user 0 org.fdroid.fdroid/.views.main.MainActivity &>/dev/null

Very hackish, but it worked perfectly last time I tried.
You might want to look into this and improve it or, perhaps, work on a cleaner integration with termux.

edited to add: more (and better) ideas here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants