9

How do I start an apk on the emulator from the console? I wasn't able to find the correct command.

I have an Ubuntu running in a VM and there the emulator. I now try to install (adb install App.apk -works!) and run it from commandline.

Thanks in advance!

Jasi
  • 463
  • 2
  • 5
  • 12
  • 1
    Possible duplicate of [How do you install an APK file in the Android emulator?](https://stackoverflow.com/questions/3480201/how-do-you-install-an-apk-file-in-the-android-emulator) – Brian Knoblauch Dec 22 '17 at 20:42

2 Answers2

16

to install:

adb -e install -r "your-apk-file-complete-path"

Now to run:

am [start|instrument]
am start [-a <action>] [-d ] [-t <mime_type>]
[-c <category> [-c <category>] ...]
[-e <extra_key> <extra_value> [-e <extra_key> <extra_value> ...]
[-n <component>] [-D] [<uri>]
am instrument [-e <arg_name> <arg_value>] [-p <prof_file>]
[-w] <component>

sample launch code

am start -a android.intent.action.MAIN -n
com.abhi.ui/com.abhi.ui.LaunchIt
Abhinava
  • 1,030
  • 9
  • 19
3

Nicely described here: http://www.android.pk/blog/general/launch-app-through-adb-shell/

nwaltham
  • 2,067
  • 1
  • 22
  • 40
  • 1
    The action argument isn't really needed in most cases unless you want to start your application by using some specific action. The -n (Component) argument should be enough in most cases. – Jordi Dec 22 '11 at 15:21