在Android中,除了從界面上啟動程序之外,還可以從命令行啟動程序,使用的是命令行工具am.
start an Activity: am start [-D]
-D: enable debugging
send a broadcast Intent: am broadcast
start an Instrumentation: am instrument [flags]
-r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
-e : set argument to
-p : write profiling data to
-w: wait for instrumentation to finish before returning
start profiling: am profile start
stop profiling: am profile stop
specifications include these flags:
[-a ] [-d ] [-t ]
[-c [-c ] ...]
[-e|--es ...]
[--ez ...]
[-e|--ei ...]
[-n ] [-f ] []
幾個啟動指定程序activity的例子
Music 和 Video(音樂和視頻)的啟動方法為:
新聞熱點
疑難解答
圖片精選