Wear OS 应用应独立于手机运行。不过,如果您的 Wear OS 应用依赖于移动应用,请参阅以下有关将模拟手表或实体手表连接到手机的信息。
将设备与手表模拟器配对
您可以通过手动方式或使用 Wear OS 模拟器配对助理将设备与手表 Android 虚拟设备 (AVD) 或模拟器配对。
使用 Wear OS 模拟器配对助理
注意:您的手机必须搭载 Android 11(API 级别 30)或更高版本,并且已安装 Google Play 商店,才能使用 Wear OS 模拟器配对助理。此外,请确保 Wear 模拟器搭载 API 级别 28 或更高级别,以便使用最新的助理功能。如需为模拟设备升级系统映像,请使用 SDK 管理器。
借助 Wear OS 模拟器配对助理,您可以更轻松地管理和连接 Wear 模拟器。您可以将多部 Wear 设备与一部虚拟或实体手机配对。Android Studio 还会记住之前已配对的设备,并在此类设备启动后重新配对。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Connect a watch to a phone\n\nWear OS apps should work independently of a phone. However, if your Wear OS app\ndepends on a mobile app, see the following information about connecting either\nan emulated watch or a physical watch to a phone.\n\nPair devices with a watch emulator\n----------------------------------\n\nYou can pair devices to your watch Android Virtual Device (AVD), or emulator, manually or by\nusing the Wear OS emulator pairing assistant.\n\n### Use the Wear OS emulator pairing assistant\n\n\n**Note:** Your phone must run Android 11 (API level 30) or\nhigher and have the Google Play Store installed to use the Wear OS\nemulator pairing assistant. Also, make sure your Wear emulators run API\nlevel 28 or higher to use the latest assistant features. To upgrade system\nimages for your emulated devices, use the\n[SDK Manager](/studio/intro/update#sdk-manager).\n\n\nThe Wear OS emulator pairing assistant makes it easier to manage and\nconnect Wear emulators. You can pair multiple Wear devices with a single\nvirtual or physical phone. Android Studio also remembers and re-pairs\npreviously paired devices when they're launched.\n\n\nTo pair two devices, follow these steps:\n\n1. If you haven't already, [create a Wear emulator](/training/wearables/get-started/creating#emulator).\n2. In the **Device Manager** , click the overflow menu icon\n next to a device you want to pair and select **Pair Wearable**.\n\n\n **Figure 1.** Overflow menu of a device that can be paired with a Wear emulator.\n\n \u003cbr /\u003e\n\n3. This launches the Wear OS emulator pairing assistant. If you selected **Pair Wearable** on the entry for a phone, you see a list of available Wear devices. If you started with a Wear device, you see a list of available phones. Select the device you want to pair and click **Next**.\n4. It might take a few minutes for Android Studio to launch and prepare the devices. If your phone doesn't have the Wear OS companion app installed, follow the prompts to log in to the Play Store, install it, and set it up.\n5. To pair your devices in the Wear OS app on your phone, click the overflow menu and select **Pair with emulator**.\n\n\nAfter your devices are successfully paired, the **Device Manager** shows small\nicons next to the paired devices. You can also click the overflow drop-down menu\nand select **View Details** to see a list of paired devices.\n**Figure 2.** The **Paired Devices** tool window shows devices paired with the selected device.\n\n### Pair a phone with the watch AVD\n\n\nIf you want a Google Account on the watch AVD for development,\nyou can pair a phone with the watch AVD and sync a Google Account by doing\nthe following:\n\n1. Follow the steps to [set up a phone](#setting-up-a-phone).\n2. On the phone, enable **Developer Options** and **USB\n Debugging**.\n3. Connect the phone to your computer through USB.\n4. Forward the AVD's communication port to the connected phone each time the phone is connected using this command: \n `adb -d forward tcp:5601 tcp:5601`\n5. In the Wear OS companion app on the phone, begin the standard pairing process. For example, on the Welcome screen, tap the **Set It Up** button. Alternatively, if an existing watch already is paired, tap **Add a New Watch** in the upper-left menu.\n6. In the Wear OS companion app on the phone, tap the overflow menu, and then tap **Pair with Emulator**.\n7. Tap the **Settings** icon.\n8. Under **Device Settings** , tap **Emulator**.\n9. Tap **Accounts** and select a Google Account. Follow the steps in the wizard to sync the account with the emulator. If necessary, type the screen-lock device password and Google Account password to start the account sync.\n\n### Connect a phone to multiple Wear devices\n\n\nTo connect a second Wear device to a virtual or physical phone, follow the same\nsteps you would for an initial pairing: locate the phone or Wear device you want\nto pair in the **Device Manager** , click the overflow menu icon, and\nclick **Pair Wearable**.\n\n\u003cbr /\u003e\n\nSet up a phone\n--------------\n\n\u003cbr /\u003e\n\n\nThis section contains information about setting up a mobile phone\nwith a Wear OS companion app.\n\n### Use the Android version of the companion app\n\n\nOn an Android phone, go to the [Wear OS by Google Smartwatch](https://play.google.com/store/apps/details?id=com.google.android.wearable.app) app listing. Tap **Update** to download and\ninstall the app. After installation, confirm that\n**Auto-update** is selected for the app. See\nthe \"How to update individual Android apps automatically\" section of [Update downloaded\napps](https://support.google.com/googleplay/answer/113412). Tap **Open** to start the app.\n\n#### Pair an Android phone to a watch\n\n\nAfter you install the companion app on a phone, unpair any obsolete watch pairings, if\nnecessary. Then pair the phone to a newly imaged watch. To do this, complete the following steps:\n\n1. On the phone, select your watch device name from the list of devices. A pairing code displays on the phone and on the watch. Check that the codes match.\n2. Tap **Pair** to continue the pairing process. When the watch connects to the phone, a confirmation message displays. On the phone, a screen displays that lists the accounts on the phone.\n3. Choose a Google account to add and sync to your watch.\n4. Confirm the screen lock and enter the password to start copying the account from the phone to the watch.\n5. Follow the instructions in the wizard to finish the pairing process.\n\n#### Companion app for iPhones\n\n\nAn iOS companion app is available for phones running iOS 8.2 or higher.\nTo install it, do the following:\n\n1. On your iPhone, visit the App Store and download and install the [Wear OS by Google](https://itunes.apple.com/us/app/android-wear/id986496028) companion app.\n2. Follow the instructions on the watch and on the phone to begin the pairing process. For additional information, see the page about [fixing setup issues with your watch](https://support.google.com/androidwear/answer/6057772?co=GENIE.Platform%3DiOS&oco=0).\n\nReuse code for a mobile app in a Wear OS module\n-----------------------------------------------\n\n\nYou can [add a module](/studio/projects/add-app-module) for a Wear OS device\nto your existing project in Android Studio to let you reuse code from your\nmobile app.\n\n### Create a Wear OS module in your existing project\n\n\nTo create a Wear OS module, open your existing Android Studio project and do the following:\n\n1. Click **File** \\\u003e **New** \\\u003e **New Module**.\n2. In the **New Module** window, select **Wear OS Module** and click **Next**.\n3. Under **Configure the new module** , enter the following:\n - **Application/Library Name**: the title of your app launcher icon for the new module\n - **Module Name**: the name of the folder for your source code and resource files\n - **Package Name** : the namespace for the code in your module. The string is added as the [`package`](/guide/topics/manifest/manifest-element#package) attribute in the module's [Android manifest file](/guide/topics/manifest/manifest-intro).\n - **Minimum SDK** : the lowest version of the platform that the app module supports. For example, select **API 26: Android 8.0** . This value sets the `minSdkVersion` attribute in the `build.gradle` file, which you can edit later.\n4. Click **Next** . You see multiple code template options. Select **Blank Wear OS Activity** and then click **Next**.\n5. In the **Configure Activity** window, enter or accept the default values for the **Activity Name** , **Layout Name** , and **Source Language** . Click **Finish**.\n\nAndroid Studio creates and syncs the files for the new module.\nAndroid Studio also adds any required dependencies for Wear OS\nto the new module's build file. The new module appears in\nthe **Project** window on the left side of the screen.\nIf you don't see the new module's folder, make sure the window is displaying the\n[Android view](/studio/projects#ProjectFiles).\n\nInclude the following in the `build.gradle` file for the new Wear OS module:\n\n- In the `android` section, set the values for `compileSdkVersion` to 33 and `targetSdkVersion` to 30.\n- Add the dependencies you need. For more information, see [Declaring dependencies](/jetpack/androidx/releases/wear#declaring_dependencies).\n- [Sync](/studio/build#sync-files) your Android Studio project. To run the code in the new module, see [Launch the\n emulator and run your Wear OS app](/training/wearables/get-started/creating#run-emulator)."]]