با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این سند اطلاعات مرجعی در مورد پیکربندی مجوزها و نقشهای Test Lab IAM ارائه میکند. اگر میخواهید نقشهای ریز بیشتری را پیکربندی کنید، Test Lab مجوزهایی را برای اجرای آزمایشها و دستگاههای پخش با استفاده از Android Studio ارائه میکند. اجرای آزمایش دارای الزامات اضافی برای پیکربندی صحیح مجوزها و نقشها برای IAM و دستگاههای پخش است.
اجرای تست
برای پیکربندی صحیح Test Lab به طوری که بتوانید نتایج آزمایش ها را اجرا کرده و بخوانید، باید دسترسی به سطل های Cloud Storage را پیکربندی کنید. این به پیکربندی خاصی از مجوزها نیاز دارد که همه در نقش های از پیش تعریف شده استاندارد Firebase گنجانده نشده اند. برای اعطای دسترسی به Test Lab ، از یکی از گزینه های زیر استفاده کنید.
برنامه خود را در یک پروژه جداگانه Firebase آزمایش کنید.
کاربرانی را که نیاز به دسترسی Test Lab دارند اضافه کنید و با استفاده از کنسول Firebase نقش های پروژه قدیمی را به آنها اختصاص دهید.
(اختیاری) نقش پروژه ویرایشگر را اختصاص دهید تا به کاربر اجازه دهد آزمایشات را با Test Lab انجام دهد.
(اختیاری) نقش پروژه Viewer را اختصاص دهید تا کاربر بتواند نتایج آزمایش را با Test Lab مشاهده کند.
آزمایش از طریق gcloud CLI
آزمایشهایی که از gcloud CLI ، Testing API ، یا دستگاههای مدیریتشده Gradle شروع شدهاند، از یک سطل Cloud Storage که توسط Firebase ایجاد شده است، بهطور پیشفرض استفاده میکنند. این امر مستلزم آن است که مدیر اجرایی آزمایش، نقش «نقش/ویرایشگر» را برای پروژه firebase شما داشته باشد.
اگر نمیتوانید آن نقش را اعطا کنید، یا میخواهید نتایج آزمایش دقیق را برای بیش از 90 روز حفظ کنید، میتوانید این نتایج آزمایش را با استفاده از گزینه خط فرمان --results-bucket gcloud به یک سطل Cloud Storage که متعلق به شماست ارسال کنید.
هنگام استفاده از سطل Cloud Storage خود:
یک جفت نقش از پیش تعریف شده را با استفاده از کنسول Google Cloud اختصاص دهید، که مجموعه مجوزهای لازم را با هم اعطا می کند.
برای اینکه کاربر بتواند آزمایشها را با Test Lab انجام دهد، هر دو را اختصاص دهید: Firebase Test Lab Admin ( roles/cloudtestservice.testAdmin ) و Firebase Analytics Viewer ( roles/firebase.analyticsViewer )
برای اینکه کاربر بتواند نتایج آزمایش را در Test Lab مشاهده کند، هر دو را اختصاص دهید: Firebase Test Lab Viewer ( roles/cloudtestservice.testViewer ) و Firebase Analytics Viewer ( roles/firebase.analyticsViewer )
مجوزها را در Device Streaming فعال کنید
Device Streaming یک ویژگی جداگانه است که بر روی دستگاه های Test Lab ساخته شده است. دسترسی مستقیم به دستگاه های Test Lab را برای شما فراهم می کند. ویراستاران و مدیران Firebase میتوانند از Device Streaming بدون هیچ نقش اضافی استفاده کنند، با این حال، در صورت لزوم میتوانید نقشهای دقیقتری نیز ارائه دهید.
برای اینکه به کاربر اجازه دهید از پخش جریانی دستگاه استفاده کند، با استفاده از کنسول Google Cloud یک نقش از پیش تعریف شده اختصاص دهید که مجموعه مجوزهای لازم را با هم اعطا می کند. نقشی که باید اختصاص داده شود، مدیر دسترسی مستقیم آزمایشگاه آزمایشی Firebase است ( roles/cloudtestservice.directAccessAdmin ).
تاریخ آخرین بهروزرسانی 2025-09-06 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-09-06 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]