简体   繁体   English

如何为AndroidManifest.xml添加权限以进行测试

[英]How to Add Permissions to AndroidManifest.xml for Tests

The docs state: 文档说明:

As mentioned previously, next to the main sourceSet is the androidTest sourceSet, located by default in src/androidTest/ .... The sourceSet should not contain an AndroidManifest.xml as it is automatically generated. 如前所述,主要的sourceSet旁边是androidTest sourceSet,默认位于src / androidTest / .... sourceSet不应包含AndroidManifest.xml,因为它是自动生成的。

So, if I want to add extra permissions for the tests, what is the correct way to do it? 因此,如果我想为测试添加额外的权限,那么正确的方法是什么?

As of version 0.13.0 (released 2014/09/18) of the Android Gradle plugin it is now possible to have a custom manifest for Android tests. 从Android Gradle插件版本0.13.0(2014/09/18发布)开始,现在可以为Android测试提供自定义清单。

It is now possible to provide a manifest for test apps (src/androidTest/AndroidManifest.xml) 现在可以为测试应用程序提供清单(src / androidTest / AndroidManifest.xml)

Source: https://sites.google.com/a/android.com/tools/tech-docs/new-build-system 资料来源: https//sites.google.com/a/android.com/tools/tech-docs/new-build-system

For more information see the sample "gradle_examples_0.14.4/tree/master/androidManifestInTest" - although it seems to me that there's no special configuration needed. 有关更多信息,请参阅示例“gradle_examples_0.14.4 / tree / master / androidManifestInTest” - 尽管在我看来,不需要特殊配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM