How to run apk from commandline in emulator

╄→尐↘猪︶ㄣ 提交于 2019-12-12 07:19:32

问题


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!


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/8605821/how-to-run-apk-from-commandline-in-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!