2011-12-22 80 views
4

如何从控制台启动模拟器上的apk?我无法找到正确的命令。如何从模拟器的命令行运行apk

我有一个运行在虚拟机中的Ubuntu,并有模拟器。我现在尝试安装(adb安装App.apk -works!)并从命令行运行它。

在此先感谢!

+0

的可能的复制[你怎么安装APK f在Android模拟器?)(https://stackoverflow.com/questions/3480201/how-do-you-install-an-apk-file-in-the-android-emulator) – 2017-12-22 20:42:00

回答

10

安装:

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

现在运行:

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> 

样品启动代码

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

我需要像这样输入:adb shell am start ...(在v1.0.29上) – Nobu 2012-05-16 23:34:14