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 ...
随机推荐
- eclipse下环境变量设置:eclipse导入工程出现 Unbound classpath variable Error
在导入网友提供的Tomcat源码工程时候出现了 The project cannot be build until build path errors are resolved Unbound cla ...
- event.keycode值大全
window.event.keycode-获取按下的键盘值 event.keycode值大全1 keycode 8 = BackSpace BackSpace 2 keycode 9 = Tab ...
- svn://59.46.115.123:13690/IOS/trunk/02.DevelopLib/04.Coding/uuridesharing
svn://59.46.115.123:13690/IOS/trunk/02.DevelopLib/04.Coding/uuridesharing
- shell中的循环
shell中的循环 for循环 类似于C语言的步长控制 例如: ;i<=;i++)); ); done 将1到10,依次乘以4,然后打印出来. 这里顺便提一下,shell里面表达式的计算,可以有 ...
- 常用webshell提权方法总结
pcAnywhere提权:1.利用pcAnywhere提权,前提条件是pcAnywhere默认安装到默认路径,以及它的目录安全权限有users权限,如果管理员删除了users和power users用 ...
- MySQL的left join中on与where的区别
关于 “A LEFT JOIN B ON 条件表达式” 的一点提醒 ON 条件(“A LEFT JOIN B ON 条件表达式”中的ON)用来决定如何从 B 表中检索数据行,即使on中包含有A表中的列 ...
- linux的free命令
free 查看内存使用情况,默认以kb为单位 Mem: total=used+free, 其中buffers和cached是已经使用的内存, 对程序的buffers和cached的理解: os 在内存 ...
- [转载]如何在Ubuntu上安装LAMP服务器系统
[2013年7月25日 51CTO外电头条]为何应该在Ubuntu上安装LAMP服务器?从事Web开发工作时,我更偏爱在不受干扰的情况下,在我那台计算机上的开发环境下进行开发.我宁愿所犯的错误大部分是 ...
- Python字符串基础操作
==============字符串======== >>> s1='www.baidu.com' >>> type(s1) <type 'str'> & ...
- We are 歪果仁带你灰
We are 歪果仁带你灰 我叫赖彦谕 不爱什么诗和远方 只爱饭桌上的一菜一肉一杯酒 真的很希望有一天我可以成为那个对待学习像对待美食一样的人类 让自己沉浸在美食和知识的海洋中无法自拔 我也对未来的软 ...