[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nThis document provides reference information about configuring Test Lab IAM\npermissions and roles. If you want to configure more granular roles, Test Lab\nprovides permissions for both executing tests and streaming devices using\nAndroid Studio. Test execution has extra requirements to properly configure\npermissions and roles for IAM and the streaming devices.\n\nTest Execution\n\nTo properly configure Test Lab so that you can execute and read the results\nof tests, you have to configure access to Cloud Storage buckets. This\nrequires a specific configuration of permissions that aren't all included in the\nstandard [Firebase predefined roles](/docs/projects/iam/roles-predefined). To\ngrant access to Test Lab, use one of the following options.\n\nTests through the Firebase console\n\nFor tests started from Firebase console or through the [Firebase Test Lab Device Matrix in Android Studio](https://developer.android.com/studio/test/test-in-android-studio#run-with-firebase-test-lab):\n\n1. Test your app in a dedicated separate Firebase project.\n2. Add users that need Test Lab access and assign them legacy project roles using the [Firebase console](//console.firebase.google.com/).\n3. (Optional) Assign the **Editor** project role to allow a user to run tests with Test Lab.\n4. (Optional) Assign the **Viewer** project role to allow a user to view test results with Test Lab.\n\nTests through gcloud CLI\n\nTests started from the [gcloud CLI](/docs/test-lab/android/command-line),\nthe [Testing API](/docs/test-lab/reference/testing/rest), or [Gradle Managed\nDevices](/docs/test-lab/android/android-studio#gmd-testlab-plugin) use a\nCloud Storage bucket created by Firebase by default. This requires the\nprincipal executing the test to have the \"roles/editor\" role for your firebase\nproject.\n\nIf you cannot grant that role, or you want to retain detailed test results for\nlonger than 90 days, you can send these test results to a Cloud Storage\nbucket that you own using the\n[**--results-bucket** gcloud command-line option](//cloud.google.com/sdk/gcloud/reference/firebase/test/android/run).\n\nWhen using your own Cloud Storage bucket:\n\n1. Assign a pair of predefined roles, which grants the required set of permissions together, using the [Google Cloud console](//cloud.google.com/iam/docs/granting-changing-revoking-access).\n2. To allow a user to run tests with Test Lab, assign both: Firebase Test Lab Admin (`roles/cloudtestservice.testAdmin`) and Firebase Analytics Viewer (`roles/firebase.analyticsViewer`)\n3. To allow a user to view test results in Test Lab, assign both: Firebase Test Lab Viewer (`roles/cloudtestservice.testViewer`) and Firebase Analytics Viewer (`roles/firebase.analyticsViewer`)\n\n| **Caution:** Users assigned these predefined roles can access *all* Cloud Storage buckets associated with the Firebase project, potentially including customer data.\n\nEnable permissions in Device Streaming\n\nDevice Streaming is a separate feature built on top of Test Lab devices. It\nprovides you with direct access to Test Lab devices. Firebase Editors and\nAdmins can use Device Streaming without any additional roles, however, you can\nalso provide more granular roles if necessary.\n\nTo allow a user to use device streaming, assign a predefined role which grants\nthe required set of permissions together, using the [Google Cloud console](//cloud.google.com/iam/docs/granting-changing-revoking-access)\n. The role to assign is Firebase Test Lab Direct Access\nAdmin (`roles/cloudtestservice.directAccessAdmin`).\n\nFor more information on Device Streaming in Android Studio, see [Device Streaming in Android Studio](https://developer.android.com/studio/preview/android-device-streaming)."]]