2011-12-22 76 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