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

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


Solution 1:[1]

You can use Termux Launcher

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

Solution 2:[2]

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.

Solution 3:[3]

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.

Solution 4:[4]

  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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stark Programmer
Solution 2 Stark Programmer
Solution 3 Undo
Solution 4 Compholio