微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – Firebase测试实验室CI上传apks

在设置我的构建服务器以使用Firebase测试实验室进行espresso测试时,我一直遇到错误.

ERROR: (gcloud.beta.test.android.run) Permission denied while fetching the default results bucket 
(Error 403: Access Not Configured. Cloud Tool Results API has not been used in project CLOUD_PROJECT_ID before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/toolresults/overview?project=CLOUD_PROJECT_ID then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.).
Is billing enabled for project: [PROJECT_ID]?

当我在我自己的机器上尝试通过我自己的帐户登录时,运行以下命令可以正常工作.

gcloud beta test android run \
  --type instrumentation \
  --app app-debug.apk \
  --test app-debug-androidTest.apk \
  --device-ids Nexus4,Nexus5 \
  --os-version-ids 18,21,25 \
  --locales en \
  --orientations portrait

在我的构建服务器上,我想使用服务帐户,但是当我执行命令时,我得到前面提到的错误.有谁知道设置它的正确方法是什么?在项目编辑器旁边,服务帐户是否需要一些特殊的角色?

在构建脚本中,我执行以下命令以在上传APK之前对项目进行身份验证和设置

gcloud config set project PROJECT_ID
gcloud auth activate-service-account service-account@email.address --key-file ~/gcloud-service-key.json

解决方法:

终于想通了.如果您要使用Firebase测试实验室的服务帐户,则必须启用Cloud Tool Results API,该API只能通过Google Cloud Console而不是Firebase控制台启用.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐