原文地址:http://blog.csdn.net/fulinwsuafcie/article/details/8092459
 
adb shell am 的功能
adb shell am
使用此命令可以从cmd控制台启动 activity, services;发送 broadcast等等:
C:\Users\Administrator>adb shell am
usage: am [subcommand] [options]

start an Activity: am start [-D] [-W] <INTENT>
        -D: enable debugging
        -W: wait for launch to complete

start a Service: am startservice <INTENT>

send a broadcast Intent: am broadcast <INTENT>

start an Instrumentation: am instrument [flags] <COMPONENT>
        -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
        -e <NAME> <VALUE>: set argument <NAME> to <VALUE>
        -p <FILE>: write profiling data to <FILE>
        -w: wait for instrumentation to finish before returning

start profiling: am profile <PROCESS> start <FILE>
    stop profiling: am profile <PROCESS> stop

start monitoring: am monitor [--gdb <port>]
        --gdb: start gdbserv on the given port at crash/ANR

<INTENT> specifications include these flags:
        [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
        [-c <CATEGORY> [-c <CATEGORY>] ...]
        [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
        [--esn <EXTRA_KEY> ...]
        [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
        [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
        [-n <COMPONENT>] [-f <FLAGS>]
        [--grant-read-uri-permission] [--grant-write-uri-permission]
        [--debug-log-resolution]
        [--activity-brought-to-front] [--activity-clear-top]
        [--activity-clear-when-task-reset] [--activity-exclude-from-recents]
        [--activity-launched-from-history] [--activity-multiple-task]
        [--activity-no-animation] [--activity-no-history]
        [--activity-no-user-action] [--activity-previous-is-top]
        [--activity-reorder-to-front] [--activity-reset-task-if-needed]
        [--activity-single-top]
        [--receiver-registered-only] [--receiver-replace-pending]
        [<URI>]

使用实例:
如启动一个 Activity:
格式:
adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。
 
实例1:
C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera
Starting: Intent { cmp=com.android.camera/.Camera }

 
实例2:(带extra 的 intent)

C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera -e abc hello
Starting: Intent { cmp=com.android.camera/.Camera (has extras) }

其中 extra 的 key 为 abc ,value 为字串 "hello"

sdk adb 下载地址http://developer.android.com/index.html

(转)adb shell am 的用法的更多相关文章

  1. adb shell am pm 用法

    Using activity manager (am) Within an adb shell, you can issue commands with the activity manager (a ...

  2. adb shell am 的用法

    adb shell am instrument [options] <COMPONENT> 作用:启动对instrument实例的监视. 参数[options]: -e <key&g ...

  3. adb shell dumpsys的用法

    一. 打印出设备中所有service的信息 zh@zh:~$adb shell dumpsys -l (字母l)zh@zh:~$adb shell service list 二.查询到运行的syste ...

  4. adb shell pm list packages的用法

    abd shell pm list packages     ####查看当前连接设备或者虚拟机的所有包 adb shell pm list packages -d    #####只输出禁用的包. ...

  5. Android系统在超级终端下必会的命令大全(adb shell命令大全)

    . 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...

  6. Android自动化测试手段之Monkey(adb shell monkey)

    一. 什么是Monkey Monkey是Android中的一个命令行工具,可以运行在模拟器里或实际设备中.它向系统发送伪随机的用户事件流(如按键输入.触摸屏输入.手势输入等),实现对正在开发的应用程序 ...

  7. adb shell am broadcast 手动发送广播及adb shell am/pm其他命令

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/zi_zhe/article/details/72229201 在命令行可用adb shell am ...

  8. adb shell 命令之----pm

    常用的用法: 查看已经安装的包: pm list packages 查看已经安装的包以及apk路径(-3:只看第三方应用: -s:只看系统应用) -f: see their associated fi ...

  9. 【android】android 常用adb 和 adb shell 命令

    db是SDK自带的工具,可实现桥接功能:adb shell 可以与手机系统建立交互,是基于andoid Linux系统下的操作 ADB常用命令: 1. 查看设备         adb  device ...

随机推荐

  1. 墨刀 手机app原型工具

    https://modao.io 并且墨刀对开放项目永久免费!

  2. 【linux】 linux 查看系统信息

    1.输入"uname -a ",可显示电脑以及操作系统的相关信息. 2.输入"cat /proc/version",说明正在运行的内核版本. 3.输入" ...

  3. HTML 文本格式化

    HTML 可定义很多供格式化输出的元素,比如粗体和斜体字. 下面有很多例子,您可以亲自试试: HTML 文本格式化实例 文本格式化 此例演示如何在一个 HTML 文件中对文本进行格式化 预格式文本 此 ...

  4. Eclipse设置UTF-8

    将Eclipse所有的设置都设置为UTF-8: 1) Window -> Preferences -> General -> Workspace -> Text file en ...

  5. 8张图带你深入理解Java

    1.字符串的不变性 下图展示了如下的代码运行过程: String s = "abcd";s = s.concat("ef");   备注:String refe ...

  6. quotas and disk replace on netapp

    ==================================================================================================== ...

  7. nokia5230 出厂设置

    你手机sim卡里的电话没事,还有储存卡里都没事,这个只是针对手机内存,如果不放心,拿你不用的手机卡,拔了内存卡格式化你好,我来具体说说吧首先如果你要单一恢复出厂设置,代码是输入*#7780#密码没改是 ...

  8. 55. Jump Game

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  9. Linux客户端、服务器、窗口管理器的关系

    嵌入式linux中文站发现很多LINUX初学者在学习linux图形方面的知识时会遇到一些概念,如:X.X11.Xfree86.WM.KDE.GNOME.QT.QT/E.Qtopia.DirectFB. ...

  10. 在编译oc中protocol时出现的错误

    Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ...