Android测试:目标应用与测试应用?

任何人都可以向我解释目标应用上下文和测试应用上下文之间的区别吗?

You can use the InstrumentationRegistry class to access information related to your test run. This class includes the Instrumentation object, target app Context object, test app Context object, and the command line arguments passed into your test.

以下摘自Android开发人员指南(此处:https://developer.android.com/tools/testing-support-library/index.html)是我想要了解的内容.

最佳答案 目标应用你的应用程序.即正在测试的应用程序. AKA是“正在测试的应用程序”.如果您想与应用程序中的内容进行交互,请在测试中使用此项 – 加载应用程序资源,发送Intent等.

测试应用程序是一个特殊的应用程序,其中包含测试的代码和资源,并具有特殊权限,可以在应用程序中浏览通常不会暴露给其他应用程序的内容.如果要加载仅测试资源,请使用此选项.

点赞