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 ...
随机推荐
- 设置ios中imageView图片自适应,
UIIimageView *imageView = [UIImageView alloc]init]; [imageView setContentScaleFactor:[[UIScreen mai ...
- 3天CSS总结
css的重点和难点是盒子模型中的margin.padding.border.属性,还有浮动也是重点.
- matlab里plot设置线形和颜色
plot(x,y,'r--')% r为颜色,--为线形
- ArcGIS 10.5 named user介绍
1 Named user概述 1.1 Named user简介 Named user是ArcGIS产品自10.3版本正式推出的一种以用户为中心的授权机制,也称"授权 ...
- git clone出现SSL错误
在学习git的时候,发现不能使用git clone从github.com下载,报了个ssl错误. Cloning into cancan... error: SSL certificate probl ...
- Python 第一课笔记
1.Hello World程序的两种方法 在windows下执行 1.编辑器里输入,不用编译 print("Hello World!") 直接就可以运行 2.可以 ...
- 编写第一个ROS(创建工作空间workspace和功能包package)
刚接触ROS,学着写了第一个程序,怕以后忘记,就将其步骤记录下来.. 首先你必须保证你电脑已安装配置好ROS. 1.创建工作空间(workspace) 我们所创建功能包package,应该全部放到一个 ...
- PHP使用正则表达式验证电话号码(手机和固定电话)
这个还不错,很有用. tel='验证的电话号码'; $isMob="/^1[3-8]{1}[0-9]{9}$/"; $isTel="/^([0-9]{3,4}-)?[0 ...
- Jmeter:相应断言介绍
Jmeter进行性能测试时,作为对上一个请求返回信息的校验,基本上断言是不可少的,今天主要介绍一下Jmeter的相应断言校验. 相应断言:即对服务器相应信息的校验判断,发送http请求后,对服务器返回 ...
- Linux常用命令及重要目录文件分析总结
1.用户切换和更改密码 sudo -i / sudo su --->切换到root用户 su user --->从root用户切换回普通用户(/home/user) sudo passwd ...