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控制台启用.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...