Laljee Tandan
Laljee Tandan

Reputation: 121

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

Upvotes: 12

Views: 34803

Answers (4)

Ali-D-Coded
Ali-D-Coded

Reputation: 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.

Upvotes: 0

Laljee Tandan
Laljee Tandan

Reputation: 121

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.

Upvotes: 0

Compholio
Compholio

Reputation: 1002

  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

Upvotes: 8

Ckysmrn
Ckysmrn

Reputation: 1

You can use Termux Launcher

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

Upvotes: 0

Related Questions