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 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 eitherInstrumentationTestCase 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, alsospecify the -r flag for am instrument, sothat 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 verifycombinations 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 filelocation, use the coverageFile key that is describedin the following entry. Note: This option requires an EMMA-instrumented |
coverageFile |
<filename> |
Overrides the default location of the EMMA coverage file on 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
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 使用此命令可以从cmd控制台启动 activity, services:发送 broadcast等等 1.am start <packageName/.classN ...
- 获取手机安装的所有包名adb shell pm list packages
获取所有已安装包的包名:adb shell pm list packages 查找:adb shell pm list packages|findstr suning
- adb shell 命令之----pm
常用的用法: 查看已经安装的包: pm list packages 查看已经安装的包以及apk路径(-3:只看第三方应用: -s:只看系统应用) -f: see their associated fi ...
- adb shell pm list packages的用法
abd shell pm list packages ####查看当前连接设备或者虚拟机的所有包 adb shell pm list packages -d #####只输出禁用的包. ...
- adb shell中的am pm命令
adb shell中的am pm命令,一些自己的见解和大多数官网的翻译. am命令 am全称activity manager,你能使用am去模拟各种系统的行为,例如去启动一个activity,强制停止 ...
- adb、adb shell am、adb shell pm命令的详细使用说明
本文博客地址:http://blog.csdn.net/qq1084283172/article/details/64183248 1.在命令行终端执行下面的命令: adb >adb.txt 2 ...
- 使用adb shell卸载程序
个人感觉在命令行中卸载程序要比在手机界面卸载程序要方便许多,配合命令行下的报名查看包名的命令就更加方便了. 1.查看应用准确包名 adb shell pm list package -f |grep ...
随机推荐
- CSS选择器4是下一代CSS选择器规范
那么,这一版本的新东西有哪些呢? 选择器配置文件 CSS选择器分为两类:快速选择器和完整选择器.快速选择器适用于动态CSS引擎.完整选择器适用于速度不占关键因素的情况,例如document.query ...
- symfony2 表单
正常情况下我还是更喜欢直接写表单而不是使用symfony内置的表单对象来穿件表单,但当我一个表单比较重要,需要csrf保护的时候 我会选择使用这种方法来表单. 官方文档有介绍一大堆通过类创建表单这里我 ...
- 优化PHP代码的40条建议(转载)
[size=5][color=Red](译文)优化PHP代码的40条建议[/color][/size] 40 Tips for optimizing your php Code 原文地址:http:/ ...
- jquery-1.10.2 获取checkbox的checked属性总是undefined
项目中用的jquery-1.10.2 需要检测一个checkbox的选中状态,想当然的用 .attr("checked") ,结果发现,无论是否选中,这个值都是 undefined ...
- Android-5 理解context
context -- 用来访问全局信息 Application用途 Application生命周期 深入理解 Context http://blog.csdn.net/z1074971432/arti ...
- C语言内存调试技巧—C语言最大难点揭秘
本文将带您了解一些良好的和内存相关的编码实践,以将内存错误保持在控制范围内.内存错误是 C 和 C++ 编程的祸根:它们很普遍,认识其严重性已有二十多年,但始终没有彻底解决,它们可能严重影响应用程序, ...
- 批量删除Kindle Personal Documents
javascript:(function(){ var v = new RegExp("amazon"); if (!v.test(document.URL)) { return ...
- 【转】 Git 常用命令详解(二)----不错
原文网址:http://blog.csdn.net/ithomer/article/details/7529022 Git 是一个很强大的分布式版本管理工具,它不但适用于管理大型开源软件的源代码(如: ...
- GBT28181中的RTP
国标中说h264数据按照RFC3984打包,但是国标的测试工具——SPVMN,却不支持RFC3984的打包方式.无奈之下直接用RFC3550的方式打包,其实就是分包,然后加上RTP头,对于一帧的结束, ...
- SQL省市区三级表结构
-- 表的结构 areaDROP TABLE area;CREATE TABLE area ( id int NOT NULL , areaID int NOT NULL, area va ...