`
isiqi
  • 浏览: 16076612 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

Android中am命令用法

阅读更多

此贴转自http://hi.baidu.com/xiaohuozi51/blog/item/9f3f92bff28dea0219d81f18.html谢谢兄弟的分享

位于frameworks/base/cmds/pm

am命令作用:管理Activity 
usage: am [start|broadcast|instrument|profile]
am start -D INTENT

am broadcast INTENT

am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]

[-w] <COMPONENT>

am profile <PROCESS> [start <PROF_FILE>|stop]

INTENT is described with:

[-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]

[-c <CATEGORY> [-c <CATEGORY>] ...]

[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]

[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]

[-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]

[-n <COMPONENT>]
[-f <FLAGS>] [<URI>]
The start command starts activity. Use -D option to make 'DebugOption' true.
The broadcast command sends broadcast.
The instrument command starts instrumentation.
Use -r option to make 'rawMode' true.
Use -e option to add the pair of ARG_NAME and ARG_VALUE into Bundle.
Use -p option to specify profileFile.
Use -w option to make 'wait' true in order to new an instance of InstrumentationWatcher.
Use COMPONENT to specify the name of the instrumentation component.
The profile command turn on/off profiling in a particular process specified by PROCESS.
Use start option to turn on and stop to turn off.Use PROF_FILE to specify the file path of profile.
Use -a to set action specified by ACTION to be performed.
Use -d to create a Uri(data) which parses the given encoded URI string DATA_URI.
Use -t to specify the type specified by MIME_TYPE. Use -c to add a new category specified by
CATEGORY
to the intent.
Use -e or --es to add extended data to the intent.EXTRA_KEY specifies the name of the extra data and
EXTRA_STRING_VALUE specifies the string data value.
Use --ez to add extended data to the intent. EXTRA_KEY specifies the name of the extra data and
EXTRA_BOOLEAN_VALUE specifies the serializable data value.
Use -e or --ei to add extended data to the intent. EXTRA_KEY specifies the name of the extra data and
EXTRA_INT_VALUE
specifies the serializable data value.
Use -n to explicitly set the component specified by COMPONENT to handle the intent.
Use -f to set special flags controlling how this intent is handled.FLAGS specifies the desired flags.
Use URI to create an intent from a URI.
分享到:
评论

相关推荐

    Android am 命令使用

    开启 Activity、服务、广播知识讲解 开启 Activity、服务、广播例子 内存、进程、性能操作 调试相关操作

    Android am命令工具类

    帮助使用am命令的工具类

    Android中使用am命令实现在命令行启动程序详解

    主要介绍了Android中使用am命令实现在命令行启动程序详解,本文详细讲解了am命令的语法,然后给出了启动内置程序的操作实例,需要的朋友可以参考下

    Android应用开发环境搭建及Eclipse使用简介.pdf

    myd_am335x开发环境搭建文档,Android应用开发环境搭建及Eclipse使用简介,在命令行窗口中输入javac命令,若显示了javac命令选项参数,表示JAVA开发环境配置成功

    AndroidMVP:AndroidMVP 是一个在 android 中更容易使用 MVP 的库

    AndroidMVP 是一个在 android 中更容易使用 MVP 的库。 ## 模型-视图-展示器 (MVP) 是模型-视图-控制器 (MVC) 架构模式的派生,主要用于构建用户界面。 MVP 是一种用户界面架构模式,旨在促进自动化单元测试并...

    ADBKeyBoard Android Virtual Keyboard Input via ADB ADBKeyBoard i

    但是你不能使用这个命令将Unicode字符,因为它是不适合使用这种方式。 参考:http://stackoverflow.com/questions/14224549/adb-shell-input-unicode-character 例如 adb shell输入文本的你好嗎” 是不打算工作。 ...

    Android系统添加自己写的工具

    android/frameworks/base/cmds 一些android重要命令:am、app_proce等 实际上这些工具都是小应用。调试串口接电脑,开启控制台可以使用这些工具。如果USB连电脑,用adb调试工具,输入adb shell指令进入控制台 。 ...

    adb1.0.26包含fastboot.exe

    注:有部分命令的支持情况可能与 Android 系统版本及定制 ROM 的实现有关。 基本用法 命令语法 adb 命令的基本语法如下: adb [-d|-e|-s ] 如果只有一个设备/模拟器连接时,可以省略掉 [-d|-e|-s ] 这一部分,...

    MubalooOrgChartTest:Android 测试项目(InstrumentationTestRunner)

    要运行测试项目,请使用以下命令 “adb shell am instrument -w com.mubaloo.org.chart.test.tests/android.test.InstrumentationTestRunner” 总共四个测试和一个 UI 测试。 TestHTTPProxyRequest - 测试 ...

    NDK20_线程轮询实现双进程守护

    1. app主进程什么时候被杀死 如何监听 2. 因为我们的进程是fork出来的,fork出来的进程父进程是app进程号当app被kill掉时,子进程被孤儿init领养 变成了空进程。怎样在监听自己变成死亡进程: ... - am命令

    Tools4&roid;(快速安装apk)老朽痴拙汉化版.

    支持自定义 shell 命令 (例如: am start -a android.intent.action.MAIN -n com.android.settings/.Settings). 导出 txt 文件, 用于输出在程序执行中的控制台操作日志。 原版下载:...

    AndroidProxy.zip

    可以通过使用adb命令快速进行wifi代理的设置和清除。 设置代理:(wifi名称不能有空格) adb shell am start -n com.lyman.proxysetter/.MainActivity -e host 代理IP地址 -e port 端口号 -e ssid WIFI名称 -e reset...

    io.appium.settings:用于处理Android设置的应用

    切换Android设备或模拟器中的设置。 一个小型且简单的Android应用程序,用于处理系统设置。 然后,应用程序关闭。 要求 您也可以考虑使用轻松调试代码。 建造 $ ./gradlew clean assembleDebug 您还可以运行...

    adbd_downcc.zip

    我相信做Android开发的朋友都用过ADB命令,但是也只是限于安装应用push文件和设备重启相关,更深的就不知道了,其实我们完全可以了解多一点,有一些不常用的场景我们至少应该知道它可以做到,比如,我们知道adb ...

    dex-test-parser:在Android工具APK中查找所有测试方法

    敏捷测试解析器 动机 dex-test-parser的灵感来自Google演讲“”。 它有什么作用? 给定一个Android工具apk,dex-test-parser将... 您可能希望为每个测试运行adb shell am instrument命令的调用,以避免测试之间的共

    ActivityLaunchTimeCollector:这是Android Activity启动时间的python脚本

    一、功能说明(仅适用于本地启动时间统计,如果要收集线上各个用户收集启动时间,可通过 AOP 实现)统计项目/模块中所有的Activity,批量执行命令 adb shell am start -W packageName/ActivityName 启动并获取输出...

    appium-uiautomator2-server:用于Android UI自动化的基于Appium UiAutomatorUiObject2的服务器。 appium-uiautomator2-driver组件使用此模块

    建筑工程使用以下命令构建android项目gradle clean assembleServerDebug assembleServerDebugAndroidTest 启动服务器将src和test apk都推送到设备并执行检测测试。 adb shell am instrument -w io.appium....

    Robotium简单示例

    也可以把两个APK都安装到手机上后,使用命令 adb shell am instrement -w com.jayway.test/android.test.InstrumentationTestRunner运行。。注意保证两个APK的签名都是使用同一个证书,否则无法运行。

    where-am-i-server:使用Wi-Fi信号信息实施和测试室内位置算法

    Android应用程序已经 目录 开始使用 首先,您将在计算机中安装Java 8和Maven。 要启动服务器,您需要键入以下命令。 mvn compile mvn exec:exec -Dexec.executable="java" 注意:您必须看一下并在更改默认的系统...

Global site tag (gtag.js) - Google Analytics