How to run apk from commandline in emulator

后端 未结 2 896
孤街浪徒
孤街浪徒 2021-01-06 10:01

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 tr

相关标签:
2条回答
  • 2021-01-06 10:46

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

    0 讨论(0)
  • 2021-01-06 10:53

    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
    
    0 讨论(0)
提交回复
热议问题