在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(音乐和视频)的启动方法为:
新闻热点
疑难解答
图片精选