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.
Asked
Active
Viewed 1,253 times
1 Answers
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