Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tài liệu này cung cấp thông tin tham khảo về cách định cấu hình các quyền và vai trò IAM Test Lab. Nếu bạn muốn định cấu hình các vai trò chi tiết hơn, Test Lab sẽ cung cấp quyền thực thi các hoạt động kiểm thử và truyền trực tuyến thiết bị bằng Android Studio. Việc thực thi kiểm thử có thêm các yêu cầu để định cấu hình đúng các quyền và vai trò cho IAM và các thiết bị truyền phát trực tiếp.
Thực thi kiểm thử
Để định cấu hình Test Lab đúng cách sao cho bạn có thể thực thi và đọc kết quả kiểm thử, bạn phải định cấu hình quyền truy cập vào các vùng chứa Cloud Storage. Việc này đòi hỏi một cấu hình cụ thể về các quyền mà không phải tất cả đều có trong các vai trò được xác định trước tiêu chuẩn trên Firebase. Để cấp quyền truy cập vào Test Lab, hãy sử dụng một trong các lựa chọn sau.
Kiểm thử ứng dụng của bạn trong một dự án Firebase riêng biệt.
Thêm những người dùng cần có quyền truy cập Test Lab và chỉ định cho họ các vai trò dự án cũ bằng bảng điều khiển Firebase.
(Không bắt buộc) Chỉ định vai trò Người chỉnh sửa cho dự án để cho phép người dùng chạy các kiểm thử bằng Test Lab.
(Không bắt buộc) Chỉ định vai trò Người xem cho dự án để cho phép người dùng xem kết quả kiểm thử bằng Test Lab.
Kiểm thử thông qua giao diện dòng lệnh gcloud
Theo mặc định, các kiểm thử bắt đầu từ gcloud CLI, Testing API hoặc Gradle Managed Devices (Thiết bị do Gradle quản lý) sẽ sử dụng một vùng chứa Cloud Storage do Firebase tạo. Điều này đòi hỏi người dùng chính thực hiện kiểm thử phải có vai trò "roles/editor" cho dự án Firebase của bạn.
Nếu không thể cấp vai trò đó hoặc muốn giữ lại kết quả kiểm thử chi tiết trong hơn 90 ngày, bạn có thể gửi các kết quả kiểm thử này đến một vùng lưu trữ Cloud Storage mà bạn sở hữu bằng cách sử dụng lựa chọn dòng lệnh --results-bucket của gcloud.
Khi sử dụng vùng chứa Cloud Storage của riêng bạn:
Chỉ định một cặp vai trò được xác định trước, cấp cùng lúc bộ quyền bắt buộc bằng cách sử dụng bảng điều khiển Google Cloud.
Để cho phép người dùng chạy thử nghiệm bằng Test Lab, hãy chỉ định cả hai vai trò: Quản trị viên Phòng thử nghiệm Firebase (roles/cloudtestservice.testAdmin) và Người xem Firebase Analytics (roles/firebase.analyticsViewer)
Để cho phép người dùng xem kết quả kiểm thử trong Test Lab, hãy chỉ định cả hai vai trò: Người xem Phòng thử nghiệm Firebase (roles/cloudtestservice.testViewer) và Người xem Analytics Firebase (roles/firebase.analyticsViewer)
Cấp quyền trong tính năng Truyền phát nội dung trên thiết bị
Truyền phát nội dung từ thiết bị là một tính năng riêng biệt được tích hợp trên các thiết bị Test Lab. Nó cho phép bạn truy cập trực tiếp vào các thiết bị Test Lab. Quản trị viên và Người chỉnh sửa Firebase có thể sử dụng tính năng Truyền trực tiếp thiết bị mà không cần có thêm vai trò nào. Tuy nhiên, bạn cũng có thể cung cấp các vai trò chi tiết hơn nếu cần.
Để cho phép người dùng sử dụng tính năng truyền trực tuyến thiết bị, hãy chỉ định một vai trò được xác định trước để cấp cho người dùng nhóm quyền cần thiết cùng một lúc bằng cách sử dụng bảng điều khiển Google Cloud. Vai trò cần chỉ định là Quản trị viên truy cập trực tiếp vào Phòng thử nghiệm Firebase (roles/cloudtestservice.directAccessAdmin).
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-06 UTC."],[],[],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)."]]