Start any application through termux command line for example chrome, youtube and some other application like cryptotabbrowser
Asked Answered
U

4

9

How to open any application available in phone or installed through termux command line? I can run only chrome with this command but how to open other applications?

am start --user 0 -n com.android.chrome/com.google.android.apps.chrome.Main
Upbear answered 2/8, 2021 at 9:9 Comment(0)
T
7
  1. configure your device in developer mode
  2. connect the device to a PC over USB
  3. install the android debugger on the PC
  4. get the list of packages on the device:
$ adb shell pm list packages -f -3

this is easiest if you grep for what you want (example: X server):

$ adb shell pm list packages -f -3 | grep -i server
package:/data/app/x.org.server-pn6gNfAPA-hplcvZLS-JsA==/base.apk=x.org.server
  1. find the list of activities for the package you want to work with:
$ PACKAGE=x.org.server
$ adb shell dumpsys package | grep -Eo $(printf "^[[:space:]]+[0-9a-f]+[[:space:]]+%s/[^[:space:]]+" "${PACKAGE}") | grep -oE "[^[:space:]]+$"
x.org.server/.RunFromOtherApp
x.org.server/.MainActivity
x.org.server/.MainActivity
  1. use your am start command with the above found activity name:
am start --user 0 -n x.org.server/.RunFromOtherApp
Ti answered 21/2, 2022 at 17:27 Comment(1)
Thank you for your answer that doesn't need any dependency. Note that you don't need adb at all: you can run am and sudo dumpsys from Termux.Roast
U
0

It is just the same answer for termux

am start --user 0 -n com.Package.name/activityclass

You can find activity class through apk info app available in Google Playstore.

Upbear answered 2/8, 2021 at 14:0 Comment(1)
apk name -->apk infoUpbear
O
0

Here's how you should do it.

am start --user 0 -n com.Package.name/activityclass

To find the activity class and stuff, there is an app called Dev Tools. You can inspect any personal app, using this app. You can also find the Activity class there, and much more.

Olympias answered 14/9, 2021 at 16:48 Comment(0)
P
0

You can use Termux Launcher

This app provides a command launch [ShortAppName] to open any app.

Paragon answered 12/10, 2021 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.