2

I have a requirement where I need to launch an app on an emulator from a standalone Java application. Is there any way of doing this?

Sheetal P
  • 43
  • 8

1 Answers1

1

Execute the following adb command using Runtime.getRuntime().exec("application.exe");

"adb shell am start PACKAGE_NAME/.ACTIVITY_NAME"

Note : ACTIVITY_NAME---> Is the name of your Launcher Activity.

Don Chakkappan
  • 7,397
  • 5
  • 44
  • 59
  • Thanks a lot Don. But the problem is I don't have access to the Activity name as it is not my app. I want to be able to launch any app installed on the emulator. Do you know if this is doable? – Sheetal P Dec 02 '14 at 06:22
  • You will get both package name & Launcher Activity name in a tricky way. http://stackoverflow.com/questions/12698814/get-launchable-activity-name-of-package-from-adb?answertab=oldest#tab-top – Don Chakkappan Dec 02 '14 at 06:30
  • Ah that's what I thought. Thanks a lot Don, this was huge help. – Sheetal P Dec 02 '14 at 06:31