How to run apk from the command line in the emulator

How can I run apk on the emulator from the console? I could not find the right team.

I have Ubuntu running in VM and there is an emulator there. Now I'm trying to install (adb install App.apk -works!) And run it from the command line.

Thanks in advance!

+4
source share
2 answers

for installation:

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> 

code run sample

 am start -a android.intent.action.MAIN -n com.abhi.ui/com.abhi.ui.LaunchIt 
+10
source

Source: https://habr.com/ru/post/1387584/


All Articles