在运行测试时,如果您收到 does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).. 错误,则执行测试的主账号可能没有对项目的正确权限。默认情况下,Firebase 会在 Google Cloud Storage 中为您创建一个存储桶,但执行测试的主账号需要拥有“roles/editor”权限,这是一种宽松的权限。如果您无法向此主账号授予该角色,可以使用 --results-bucket gcloud 命令行选项。
[null,null,["最后更新时间 (UTC):2025-08-16。"],[],[],null,["\u003cbr /\u003e\n\nThere are multiple ways to use Firebase Test Lab to run tests on\nyour Android app, including the [command line interface](/docs/test-lab/android/command-line),\n[Android Studio](/docs/test-lab/android/android-studio), the [Test Lab UI](/docs/test-lab/android/firebase-console) in the\nFirebase console, and the [Testing API](/docs/test-lab/reference/testing/rest).\nHowever you choose to start your tests, the results are\nstored in the Firebase project that you specify. You can explore the results using\n[ToolResults API](//developers.google.com/apis-explorer/#search/toolresults/toolresults/v1beta3/)\nin addition to any of the tools above. This page describes how to\nreview and analyze these test results.\n\nKey concepts\n\nTo see the results from all your previous test runs, select **Test Lab** in the\nleft navigation panel of your project in the\nFirebase console. This page displays all the test runs from the\napps that you have tested with your project using Test Lab.\n\nTo review test results, you first need to understand three concepts:\n\nWhen you run a test or a set of test cases against devices and configurations\nyou've selected, Test Lab runs the test against your app in a batch, then\ndisplays the results as a **test matrix**.\n\n**Devices × Test Executions = Test Matrix**\n\nDevice\n: A physical or virtual device (Android only) you run a test on, such as a\n phone, tablet, or wearable device. Devices in a test matrix are identified by\n device model, OS version, screen orientation, and locale (also known as\n geography and language settings).\n\nTest, test execution\n: A test (or a set of test cases) to be run on a device. You can run one test\n per device, or optionally shard the test and run its test cases on\n different devices.\n\nTest matrix\n: Contains the statuses and test results for your test executions. If any\n test execution in a matrix fails, the whole matrix fails.\n\nThe following sections explain how to navigate test results.\n\nInterpret test history results\n\nWhen you navigate to your test results by selecting **Test Lab**, you see\nthe results of tests you have run so far.\n\nTesting history is grouped by app. Only the most recent five test matrices are\nshown for each app; if more are available, you can click the **All Matrices**\nlink at the bottom of the app test list to see the complete list for that app.\n\nInterpret test matrix results\n\nWhen starting a test through the [Test Lab UI](/docs/test-lab/android/firebase-console), you are\nredirected to a page where you can see your test matrix and click a specific\ntest execution to view test results. [Android Studio](/docs/test-lab/android/android-studio)\nand [the gcloud command](/docs/test-lab/android/command-line) provide a URL for the test matrix\nresults page as well.\n\nIn a typical test matrix, you might run a test across a dozen or so different\ndevices. Each test execution can have a different outcome. The possible outcomes\nfor any test execution in a test matrix include the following:\n\n- Passed : No failures were encountered.\n- Failed : At least one failure was encountered.\n- Inconclusive : Test results were inconclusive, possibly due to a Test Lab error.\n- Skipped : The selected dimension values for some test executions in the matrix were incompatible. This occurs when devices that you selected are incompatible with one or more of the Android API levels that you selected.\n\nTo review aggregated test results for all test matrices for a given app in your\nFirebase project, click the name of the app, as shown in the following example:\n\n*Example test matrix results page with only four test executions*\n\nThis takes you to the test matrix list for your app, where you can click the\nname of any test matrix to see the test matrix results, and where you can click\nthe name of the app (shown in the red box below) to view the test matrix list\nfor other apps associated with your Firebase project.\n\n*Example test matrix list page*\n\nA test matrix can pass, fail, or be inconclusive. A test matrix is shown\nas failed or inconclusive if any test executions in that matrix fail or are\ninconclusive.\n| **Note:** **Device issues sometimes increase test execution time.** If you notice that a test is taking longer than usual, it could be a sign of an issue in Test Lab. Don't worry, though, Test Lab only charges you for the time your test is actually running.\n| **Note:** **Crashes can result in skipped tests.** If some of your test cases don't appear in your results, it might be due to a crash that terminated the Test Lab test runner. To prevent a crash in one test from impacting other tests, run each test case in isolation with the [Android Test Orchestrator](/docs/test-lab/android/firebase-console#new_instrumentation_tests_with_orchestrator).\n\nInterpret Robo test results\n\nIf you ran your tests with Robo, your results include videos and screenshots of\nRobo crawling your UI, in addition to the usual test metrics. Those video and\nscreenshots include visual indications of the actions Robo took during the crawl,\nsimilar to the 'Show touches' feature in Android. You can use the indications to\nhelp you follow along with Robo's progress, and reproduce any bugs it might\nuncover.\n\n*Example Robo test results video*\n\nInterpret results from a single test execution\n\nFrom the test matrix results page, click on one of the test executions to see\nthe result of that specific test execution.\n\n*Example test execution results page*\n\nOn this page, you can see the time required for each test execution. You can\nalso see the results for specific test cases that correspond to methods in your\ntest APK (for instrumentation tests) and detailed test results, including test\nlogs, screenshots, and videos. For [Robo test](/docs/test-lab/android/robo-ux-test), detailed test\nresults also include an activity map that graphically shows the UI paths that\nwere visited by Robo test.\n\nPartitioned instrumentation test results\n\nTo help you interpret instrumented test results, Test Lab separates each test\ninto its own detailed report page, complete with stack traces, logs, and videos.\nThis feature works whether or not you are using Android Orchestrator.\n\n*Example testcase results page*\n\nInterpret accessibility results\n\nRobo tests use Android Accessibility Scanner to detect accessibility issues\nin your app (note that you can also run a scan locally on your device).\nFor instructions on how to review and interpret the\naccessibility results of your Robo test, visit\n[Get started with Accessibility Scanner](https://support.google.com/accessibility/android/faq/6376582?hl=en&visit_id=637237771125039843-484192898&rd=1).\n\nFor general information on how to improve the accessibility of your app, visit\nthe [Android Developer Accessibility documentation](https://developer.android.com/guide/topics/ui/accessibility/index.html).\n\nPerformance metrics\n\nTests run on physical devices also return performance metrics:\n\n| Metric | Required device configuration |\n|-------------------|----------------------------------------------------------------------------------------------------------|\n| App startup time | API 19+ |\n| CPU usage | API 21+ |\n| Memory usage | API 21+ |\n| Network activity | API 21+ |\n| Frames per second | API 21+ and includes a [`SurfaceView`](https://developer.android.com/reference/android/view/SurfaceView) |\n\nDetailed test results\n\nDetailed test results are available for 90 days after you run a test and are\nstored in a Google Cloud Storage bucket (but are also visible in the\nFirebase console). You can view detailed test results in the Cloud Storage\nbucket when you click **Test results** on the test execution results page.\nWhen detailed test results are no longer available, you can still see which\ntests passed or failed.\n\nIf you want to retain detailed test results for longer than 90 days, you can\nsend these test results to a Cloud Storage bucket that you own using the\n[**--results-bucket** gcloud command-line option](//cloud.google.com/sdk/gcloud/reference/firebase/test/android/run).\nYou can then set the **Age** setting to determine how long results are stored in\nyour Cloud Storage bucket. See\n[Lifecycle conditions](//cloud.google.com/storage/docs/lifecycle#conditions)\nfor information about how to change the **Age** setting.\n| **Note:** The project that owns this Cloud Storage bucket must have billing enabled to retain detailed test results for longer than 90 days.\n\nWhen running a test, if you receive the error, `does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist)..`, the principal executing the test may not have the correct permission on the project. By default, Firebase creates a bucket for you in Google Cloud Storage, however, it requires the principal executing the test to have \"roles/editor\", which is a permissive role. If you cannot grant that role to the principal, you can use the [**--results-bucket** gcloud command-line option](//cloud.google.com/sdk/gcloud/reference/firebase/test/android/run)."]]