Android_adb shell am/pm使用
adb shell am instrument [options] <COMPONENT>
作用:启动对instrument实例的监视。
参数[options]:
-e <key> <value> // -e选项需要放在-w选项之前
作用:提供了以键值对形式存在的测试选项。Android中提供了多种键值对,具体参见下表。
举例:-e class com.android.phone.FIncomingCallTests#testRejectCall
-r
作用:以原始形式输出测试结果。该选项通常是在性能测试时与-e perf true一起使用。
参数 <COMPONENT>:
-w <test_package_name>/<runner_class> //<test_package_name>和<runner_class>在测试工程的AndroidManifest.xml中查找
作用:保持adb shell打开直至测试完成
举例:-w com.android.phone.tests/com.android.phone.runners.FunctionalTestRunner
<key> <value>参考表
Key | Value | Description |
---|---|---|
package |
<Java_package_name> | The fully-qualified Java package name for one of the packages in the test application. Any test case class that uses this package name is executed. Notice that this is not anAndroid package name; a test package has a single Android package name but may have several Java packages within it. |
class |
<class_name> | The fully-qualified Java class name for one of the test case classes. Only this test case class is executed. |
<class_name>#method name | A fully-qualified test case class name, and one of its methods. Only this method is executed. Note the hash mark (#) between the class name and the method name. | |
func |
true |
Runs all test classes that extend InstrumentationTestCase . |
unit |
true |
Runs all test classes that do not extend either InstrumentationTestCase orPerformanceTestCase . |
size |
[small | medium |large ] |
Runs a test method annotated by size. The annotations are @SmallTest ,@MediumTest , and @LargeTest . |
perf |
true |
Runs all test classes that implement PerformanceTestCase . When you use this option, also specify the -r flag for am instrument , so that the output is kept in raw format and not re-formatted as test results. |
debug |
true |
Runs tests in debug mode. |
log |
true |
Loads and logs all specified tests, but does not run them. The test information appears in STDOUT . Use this to verify combinations of other filters and test specifications. |
emma |
true |
Runs an EMMA code coverage analysis and writes the output to/data//coverage.ec on the device. To override the file location, use thecoverageFile key that is described in the following entry.
Note: This option requires an EMMA-instrumented build of the test application, which you can generate with the |
coverageFile |
<filename> |
Overrides the default location of the EMMA coverage file on the device. Specify this value as a path and filename in UNIX format. The default filename is described in the entry for the |
adb shell am start [options] <INTENT>
作用:启动一个activity
举例:adb shell am start -a com.lt.test.action.SECOND
举例:adb shell am start -n com.lt.test/.MyActivity
说明:[options]与<INTENT>参见 http://developer.android.com/tools/help/adb.html#am
adb shell am startservice [options] <INTENT>
作用:启动一个service
举例:adb shell am startservice -a com.lt.test.action.ONESERVICE
举例:adb shell am startservice -n com.lt.test/.MyService
adb shell am force-stop <PACKAGE>
作用:强制关闭一个应用程序
举例:adb shell am force-stop com.lt.test
adb shell am broadcast [options] <INTENT>
作用:发送一个广播
举例:adb shell am broadcast -a "action_finish" (发送一个广播去关闭一个activity)
举例:adb shell am broadcast -a android.intent.action.MASTER_CLEAR(恢复出厂设置的方法,会清除内存所有内容)
举例:adb shell am broadcast -n com.lt.test/.MyBroadcast
adb shell pm list packages [options] <INTENT>
作用:列举出所有包含<INTENT>的package
举例:adb shell pm list packages com.lt
说明:[options]与<INTENT>参见 http://developer.android.com/tools/help/adb.html#pm
参考链接:
Android_adb shell am/pm使用的更多相关文章
- adb shell am broadcast 手动发送广播及adb shell am/pm其他命令
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/zi_zhe/article/details/72229201 在命令行可用adb shell am ...
- adb shell am pm 用法
Using activity manager (am) Within an adb shell, you can issue commands with the activity manager (a ...
- adb shell am pm
adb shell am instrument [options] <COMPONENT> 作用:启动对instrument实例的监视. 参数[options]: -e <key&g ...
- adb shell am/pm 常用命令详解与使用
一.adb shell am 使用此命令可以从cmd控制台启动 activity, services:发送 broadcast等等 1.am start <packageName/.classN ...
- adb shell am命令
adb shell am命令是在cmd命令行可以通过命令来启动Activity,Boradcast,Service等,更多使用可以参考下面附件. 比如在cmd串口我们发送广播,广播action是&qu ...
- 【Android】-- adb shell 命令探索
ADB是什么,做android开发的没有不知道的. window下执行cmd,输入adb help就会打印adb都可以做的事情,包含 adb push ..adb pull .. adb device ...
- Android自动化学习笔记:获取APK包名的几种方法
---------------------------------------------------------------------------------------------------- ...
- 常用的adb命令
在平时的工作中,会经常用到adb命令,在这里稍微整理了一下. 一.概要 1.什么是adb? adb全称为Android Debug Bridge,就是起到调试桥的作用.顾名思义,adb就是一个debu ...
- WebApiContrib
https://github.com/WebApiContrib ASP.NET Web API and Protocol Buffers Protocol Buffers are a super e ...
随机推荐
- Oracle大数据常见优化查询
[转]http://www.cnblogs.com/myhappylife/p/5006774.html 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的 ...
- N个数全排列的非递归算法
//N个数全排列的非递归算法 #include"stdio.h" void swap(int &a, int &b) { int temp; temp = a; a ...
- ajax局部更新
js //点击启用 $(".status").on("click",function(){ var id = $(this).attr("status ...
- WPF 检测输入状态
[DllImport("user32.dll")] static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); pub ...
- 模板插件aTpl
摘要: 前面给大家分享了一款js模板插件,后来经过完善推荐给大家.该插件支持ie5+,chrome等浏览器以及移动端浏览器,支持for和if语法,以及表达式. 项目地址:https://github. ...
- CSS 定义上划线、下划线、删除线代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Invalid Binary错误怎么解决
Invalid Binary错误怎么解决? 本文永久地址为http://www.cnblogs.com/ChenYilong/p/3989829.html ,转载请注明出处. iOS8升级过程中, ...
- Robot Motion(imitate)
Robot Motion Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11065 Accepted: 5378 Des ...
- java web dao 层和dao 实现层有什么好处
接口是为了屏蔽不同数据库的JDBC实现差异而出现的. 以常见的系统组织结构为例,管理系统里有一个部门department表用于存放部门信息,因为部门下面可能有子部门所以表中的字段要定义成类似树形结构的 ...
- unity3d中资源文件从MAX或者MAYA中导出的注意事项
原地址:http://blog.sina.com.cn/s/blog_6ad33d3501011ekx.html 之前在项目中,没有怎么接触过美术的软件(之前的美术团队很犀利,被他们宠坏了).在自己公 ...