1

Like the title above, I need to launch an application using command line programmatically. I have searched for hours, but can't figure it out how to do this, don't know where to start in code. Please help me .If possible, please leave some explanations.

Androidizing
  • 87
  • 2
  • 11

1 Answers1

0

I found out some useful commands:

=>Start an app knowing package name: String commandline = "monkey -p " + packagename + " -c android.intent.category.LAUNCHER 1";

=>Start an activity knowing packname + activity name: String commandline = "am start -n " + com.package.name/com.package.name.ActivityName;

=>Start a service: String commandline = "am startservice "+ com.some.package.name/.YourServiceSubClassName;

Androidizing
  • 87
  • 2
  • 11