Android adb 启动应用的方法

作者: 凯恩_Kane | 来源:发表于2019-02-20 13:26 被阅读16次

在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】

相关文章

网友评论

    本文标题:Android adb 启动应用的方法

    本文链接:https://www.haomeiwen.com/subject/gdfhyqtx.html