无法从Firebase gcloud命令行启动仪器测试 [英] Failed to start an instrument test from Firebase gcloud command line

查看:136
本文介绍了无法从Firebase gcloud命令行启动仪器测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Firebase测试实验室测试一个应用程序,但得到一个错误,提示testOnly APKs不允许。

  C:\temp> gcloud firebase test android run --type instrumentation --app myapp.apk --test myapp-androidTest.apk --device model = Nexus10,version = 22,locale = en,orientation = landscape --timeout 300s 

有问题,反馈或问题?通过访问获取支持:
https://firebase.google.com/support/

将[myapp.apk]上传到Firebase测试实验室...
正在上传[myapp- androidTest.apk]转换为Firebase测试实验室...
原始结果将存储在您的GCS存储区[https://console.developers.google.com/storage/browser/test-lab-j9zwyqscmy0rw-k53tazzivjxvu/ 2017-10-16_11:56:43.691000_AcnJ /]

测试[matrix-1vxb29yr0b2z7]已在Google Cloud中创建。
Firebase测试实验室将在1台设备上执行您的仪器测试。
创建单个测试执行失败。
错误:(gcloud.firebase.test.android.run)
矩阵[matrix-1vxb29yr0b2z7]验证失败:在test中找到testOnly。 testOnly APK是不允许的。

C:\temp>

但是,当我在Android Studio 3.0 RC1中运行它时,firebase测试可以通过将部署目标选项设置为Firebase测试实验室设备矩阵。

我在我的项目中搜索了testOnly,但没有找到它。它看起来像是gradle注入到AndroidManifest.xml的属性。



有谁知道如何解决它?

解决方案

这是Android Studio添加的字段。请参阅文档developer.android.com/guide/topics/manifest/...当您单击运行时,Android Studio自动添加此属性。不使用Android Studio,我从命令行构建了一个APK,然后我可以将其上传到Firebase测试实验室进行测试。

I tried to test an app with Firebase Test lab but get an error saying "testOnly APKs are not allowed."

C:\temp>gcloud firebase test android run     --type instrumentation  --app myapp.apk      --test myapp-androidTest.apk    --device model=Nexus10,version=22,locale=en,orientation=landscape       --timeout 300s

Have questions, feedback, or issues? Get support by visiting:
  https://firebase.google.com/support/

Uploading [myapp.apk] to Firebase Test Lab...
Uploading [myapp-androidTest.apk] to Firebase Test Lab...
Raw results will be stored in your GCS bucket at [https://console.developers.google.com/storage/browser/test-lab-j9zwyqscmy0rw-k53tazzivjxvu/2017-10-16_11:56:43.691000_AcnJ/]

Test [matrix-1vxb29yr0b2z7] has been created in the Google Cloud.
Firebase Test Lab will execute your instrumentation test on 1 device(s).
Creating individual test executions...failed.
ERROR: (gcloud.firebase.test.android.run)
Matrix [matrix-1vxb29yr0b2z7] failed during validation: "testOnly" found in the Manifest. testOnly APKs are not allowed.

C:\temp>

But the firebase test works when I run it in Android Studio 3.0 RC1 by setting the deployment target options to "Firebase Test Lab Device Matrix".

I searched "testOnly" in my project but not found it. It looks like it was gradle injected the attribute into AndroidManifest.xml.

Does anyone know how to resolve it?

解决方案

It was Android Studio added the field. Refer to the document developer.android.com/guide/topics/manifest/… "Android Studio automatically adds this attribute when you click Run". Not using Android Studio, I built an APK from the command line then I can upload it to Firebase Test Lab for testing.

这篇关于无法从Firebase gcloud命令行启动仪器测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆