在设置我的构建服务器以使用 Firebase 测试实验室进行浓缩咖啡测试时,我一直遇到错误。
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
在我的构建服务器上,我想使用服务帐户,但是当我执行命令时,我得到了前面提到的错误。有谁知道正确的设置方法是什么?服务帐户是否需要一些特殊角色project editor
?
在构建脚本中,我在上传 APK 之前执行以下命令来验证和设置项目
gcloud config set project PROJECT_ID
gcloud auth activate-service-account service-account@email.address --key-file ~/gcloud-service-key.json