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 InstrumentationTestCaseor 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 ...
随机推荐
- jquery 复选框
jquery 选中复选框 $("input[type='checkbox']").prop("checked", true); jquery 判断复选框是否被选 ...
- mongo数据库备份与恢复
备份:mongodump -h xx --port 27017 -u user -p pass -d database -o D:\backup\database 恢复:mongorestore -h ...
- iOS身份证号码识别
一.前言 身份证识别,又称OCR技术.OCR技术是光学字符识别的缩写,是通过扫描等光学输入方式将各种票据.报刊.书籍.文稿及其它印刷品的文字转化为图像信息,再利用文字识别技术将图像信息转化为可以使 ...
- 永洪BI配置测试及遇到的一些问题
1.连oracle 11g数据库遇到密码不能验证通过. 在11g中, 数据库默认密码的大小写是敏感的,jdbc在给oracle密码时, 会将其变成大写.其他个别情况也会出现变成小写的. 为统一,去除o ...
- 详细解析Java中抽象类和接口的区别(转)
转自:http://dev.yesky.com/436/7581936.shtml 在Java语言中, abstract class 和interface 是支持抽象类定义的两种机制.正是由于这两种机 ...
- 博客word测试
博客word测试 博客word测试 from __future__ import division, print_functionDOCLINES = (__doc__ or '').split(&q ...
- 实验吧Web-天网管理系统
笔记 == : 比较运算符号 不会检查条件式的表达式的类型 ===: 恒等计算符 , 同时检查表达式的值与类型.(会检查表达式类型,如bool) PHP序列化与反序列化serialize() 对输 ...
- 大数据时代之hadoop(四):hadoop 分布式文件系统(HDFS)
分布式文件系统即是网络中多台计算机组合在一起提供一个统一存储及管理的系统. Hadoop提供了一个文件系统接口和多个分布式文件系统实现,其中比较重要的就是HDFS(Hadoop Distributed ...
- 用户代理检测与浏览器Ua详细分析
用户代理检测与浏览器Ua详细分析:http://www.cnblogs.com/hykun/p/Ua.html
- 网页弹出窗口工具推荐之jqmodal
各种在jquery基础上实现的弹出窗口,有详细的开发说明文档.在项目中快速实现网页中弹出窗口的需求.基本能满足各种弹出窗口的需求 其官方网址如下http://jquery.iceburg.net/jq ...