adb shell am 的用法
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 an Android 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 or PerformanceTestCase . |
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
参考链接:
http://developer.android.com/tools/help/adb.html
摘自:http://blog.sina.com.cn/s/blog_51335a0001017ux5.html
adb shell am 的用法的更多相关文章
- (转)adb shell am 的用法
原文地址:http://blog.csdn.net/fulinwsuafcie/article/details/8092459 adb shell am 的功能 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 dumpsys的用法
一. 打印出设备中所有service的信息 zh@zh:~$adb shell dumpsys -l (字母l)zh@zh:~$adb shell service list 二.查询到运行的syste ...
- adb shell pm list packages的用法
abd shell pm list packages ####查看当前连接设备或者虚拟机的所有包 adb shell pm list packages -d #####只输出禁用的包. ...
- Android系统在超级终端下必会的命令大全(adb shell命令大全)
. 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...
- Android自动化测试手段之Monkey(adb shell monkey)
一. 什么是Monkey Monkey是Android中的一个命令行工具,可以运行在模拟器里或实际设备中.它向系统发送伪随机的用户事件流(如按键输入.触摸屏输入.手势输入等),实现对正在开发的应用程序 ...
- adb shell am broadcast 手动发送广播及adb shell am/pm其他命令
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/zi_zhe/article/details/72229201 在命令行可用adb shell am ...
- adb shell 命令之----pm
常用的用法: 查看已经安装的包: pm list packages 查看已经安装的包以及apk路径(-3:只看第三方应用: -s:只看系统应用) -f: see their associated fi ...
- 【android】android 常用adb 和 adb shell 命令
db是SDK自带的工具,可实现桥接功能:adb shell 可以与手机系统建立交互,是基于andoid Linux系统下的操作 ADB常用命令: 1. 查看设备 adb device ...
随机推荐
- Python 智能处理方向的工具
机器视觉类:OpenCV. 自然语言处理:NLTK, jieba(Python中文分词组件),HanLP, FudanNLP, NLPIR, http://tm.itc.ntnu.edu.tw/CNL ...
- HDU 4291 A Short problem(2012 ACM/ICPC Asia Regional Chengdu Online)
HDU 4291 A Short problem(2012 ACM/ICPC Asia Regional Chengdu Online) 题目链接http://acm.hdu.edu.cn/showp ...
- Hive 安装过程中的问题
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0. ...
- Java中泛型的理解
Java中的泛型,本质上来说,就是是参数化类型,就是说所操作的数据类型被指定为一个参数,而不是确定的某种类型.这种数据类型可以用在类.接口和方法创建中.即泛型类.泛型接口.泛型方法.这样说可能不够生动 ...
- nodejs在cmd提示不是内部或外部命令解决方法
今天用cmd安装个库,结果发现node不是内部命令,于是搜索了下解决方法,发现原来我上次重装nodejs换了个安装位置,path环境变量忘改了. 找到变量值中node的安装地址,比如C:develop ...
- maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade
错误: org.apache.catalina.core.StandardContext listenerStart严重: Error configuring application listener ...
- 【转】HTML-based script和URL-based script两种脚本录制方式
在Web(HTTP/HTML)录制中,有2种重要的录制模式.用户该选择那种录制模式呢?HTML-mode录制是缺省也是推荐的录制模式.它录制当前网页中的HTML动作.在录制会话过程中不会录制所有的资源 ...
- 《JS权威指南学习总结--9.1 类和模板》
内容要点: 一.JS类 在JS中,类的所有实例对象都从同一个原型对象上继承属性.因此,原型对象是类的核心.在例6.1 原型中定义了inherit()函数(通过原型继承创建一个新对象),这个函数返回一个 ...
- 《JS权威指南学习总结--8.8.3 不完全函数》
内容要点: 本节讨论的是一种函数变换技巧,即把一次完整的函数调用拆成多次函数调用,每次传入的实参都是完整实参的一部分,每个拆分开的函数叫做不完全函数(partial function),每次函数调用叫 ...
- MVC5 + EF6酒店项目笔记
最近项目组准备用MVC5开发酒店模板包括后台.在此第一次学MVC5一个礼拜,看着组长给我的MVC5模板从一脸懵逼到懵懂. 慢慢学习,成长. 未完待续........