Android adb 啟動應用的方法
在Android中,除了從介面上啟動程式之外,還可以從命令列啟動程式,使用的是命令列工具am.
usage: am [subcommand] [options]
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 ] []
啟動的方法為
$ adb shell $ am start -n {包(package)名}/{包名}.{活動(activity)名稱}
歡迎掃碼加入QQ群一起學習討論。【QQ群:930039263】
