透過 Android 裝置串流,您可以在 Android Studio 中,與 Google 安全資料中心內多個 API 級別和外型的裝置互動,並測試應用程式。透過裝置串流功能,您可以在實際裝置上與應用程式互動,就像使用者一樣,包括旋轉和折疊裝置。這樣一來,您就能瞭解應用程式在不同情況下的行為,並找出其他測試環境中可能不明顯的問題。
[[["容易理解","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\nAndroid Device Streaming lets you interact with and test your apps across\nmultiple API levels and form factors in Google's secure data centers within\nAndroid Studio. With device streaming, you can interact with your app on a real\ndevice, just like a user would, including rotating and folding the device. This\nlets you see how your app behaves in different situations and to identify\nany problems that might not be apparent in other testing environments.\n\nGet started with Android Device Streaming\n\nIf you haven't done so already, download and install the latest Stable build\nof [Android Studio](https://developer.android.com/studio/) and\nfollow these steps:\n\n1. In Android Studio, open an Android project and navigate to the **Device\n Manager** tool window and click the Firebase icon.\n2. If you're not already signed in to your developer account, click **Log in to\n Google** and follow the prompts.\n3. After providing Android Studio with the requested permissions, return to the IDE and select a Firebase project. If you don't have a Firebase project, you can create one at no cost in the [Firebase console](https://console.firebase.google.com/). Note: To enable the proper permissions to use device streaming with your Firebase project, see [Test Lab permissions](#enable-testlab-permissions).\n4. After selecting a project, you can browse the list of devices and select the devices you want to use.\n5. Click **OK**.\n\nFor more information on how to get started with device streaming, see [Device Streaming in Android Studio](https://developer.android.com/studio/run/android-device-streaming).\n\nEnable permissions for Android Device Streaming\n\nTo use Device Streaming, you need to use a Firebase project that you have either\n**Editor** or **Owner** permissions. If you want to provide more specific roles\nand permissions to your team, you can enable [Test Lab\npermissions](#enable-testlab-permissions) for Device Streaming.\n\nTest Lab permissions\n\nTo configure Test Lab permissions so that you can execute and read your test\nresults, you have to configure access to Cloud Storage buckets. You can grant\naccess to Test Lab, using the Firebase console or gcloud CLI.\n\nFor a user to run tests or view test results from the Firebase console or the\n[Test Lab Device Matrix in Android Studio](https://developer.android.com/studio/test/test-in-android-studio#run-with-firebase-test-lab),\nyou will need to assign them the Editor and Viewer project roles.\n\nFor a user to run tests or view test results from the gcloud CLI while using\nyour own Cloud Storage bucket, you can assign a pair of predefined roles, that\nwill grant the required set of permissions together, using the Google Cloud\nconsole.\n\n- To run test, assign the Firebase Test Lab Admin and Firebase Analytics Viewer roles.\n- To view test results, assign the Firebase Test Lab Viewer and Firebase Analytics Viewer roles.\n\nFor more information on how to configure these granular Test Lab permissions,\nsee Test Lab's [IAM permissions reference guide](/docs/test-lab/android/iam-permissions-reference)."]]