栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Android:Instrumentation

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Android:Instrumentation

先看一下官方的对Instrumentation的说明:

base class for implementing application instrumentation code. When running with instrumentation turned on, this class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application. An Instrumentation implementation is described to the system through an AndroidManifest.xml's tag.

大概意思是说, Instrumentation 是一个可以在任何application执行代码之前,可以监视app和系统的交互。并且可以在AndroidManifest中配置。

Instrumentation是提供给开发人员写测试用例用的,它可以拦截和操作activity,application,发送按键,touch等工作。不过现在自动化测试已经有更好用的UiAutomation。

如果你研究过Android的源代码,就会发现Activity和ActivityThread中很多地方就用到了Instrumentation。

那我们就来看看它里面与我们接触最多的代码的流转过程。

Instrumentation的创建

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/644802.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号