Wear OS apps should work independently of a phone. However, if your Wear OS app depends on a mobile app, see the following information about connecting either an emulated watch or a physical watch to a phone.
Pair devices with a watch emulator
You can pair devices to your watch Android Virtual Device (AVD), or emulator, manually or by using the Wear OS emulator pairing assistant.
Use the Wear OS emulator pairing assistant
Note: Your phone must run Android 11 (API level 30) or higher and have the Google Play Store installed to use the Wear OS emulator pairing assistant. Also, make sure your Wear emulators run API level 28 or higher to use the latest assistant features. To upgrade system images for your emulated devices, use the SDK Manager.
The Wear OS emulator pairing assistant makes it easier to manage and connect Wear emulators. You can pair multiple Wear devices with a single virtual or physical phone. Android Studio also remembers and re-pairs previously paired devices when they're launched.
To pair two devices, follow these steps:
- If you haven't already, create a Wear emulator.
-
In the Device Manager, click the overflow menu icon next to a device you want to pair and select Pair Wearable.
- 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.
- 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.
- To pair your devices in the Wear OS app on your phone, click the overflow menu and select Pair with emulator.
After your devices are successfully paired, the Device Manager shows small icons next to the paired devices. You can also click the overflow drop-down menu and select View Details to see a list of paired devices.
Pair a phone with the watch AVD
If you want a Google account on the watch AVD for development, you can pair a phone with the watch AVD and sync a Google account by doing the following:
- Follow the steps to set up a phone.
- On the phone, enable Developer Options and USB Debugging.
- Connect the phone to your computer through USB.
-
Forward the AVD's communication port to the connected phone each time
the phone is connected using this command:
adb -d forward tcp:5601 tcp:5601
- 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.
- In the Wear OS companion app on the phone, tap the overflow menu, and then tap Pair with Emulator.
- Tap the Settings icon.
- Under Device Settings, tap Emulator.
- 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.
Connect a phone to multiple Wear devices
To connect a second Wear device to a virtual or physical phone, follow the same steps you would for an initial pairing: locate the phone or Wear device you want to pair in the Device Manager, click the overflow menu icon, and click Pair Wearable.
Set up a phone
This section contains information about setting up a mobile phone with a Wear OS companion app.
Use the Android version of the companion app
On an Android phone, go to the Wear OS by Google Smartwatch app listing. Tap Update to download and install the app. After installation, confirm that Auto-update is selected for the app. See the "How to update individual Android apps automatically" section of Update downloaded apps. Tap Open to start the app.
Pair an Android phone to a watch
After you install the companion app on a phone, unpair any obsolete watch pairings, if necessary. Then pair the phone to a newly imaged watch. To do this, complete the following steps:
- 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.
- 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.
- Choose a Google account to add and sync to your watch.
- Confirm the screen lock and enter the password to start copying the account from the phone to the watch.
- Follow the instructions in the wizard to finish the pairing process.
Companion app for iPhones
An iOS companion app is available for phones running iOS 8.2 or higher. To install it, do the following:
- On your iPhone, visit the App Store and download and install the Wear OS by Google companion app.
- 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.
Reuse code for a mobile app in a Wear OS module
You can add a module for a Wear OS device to your existing project in Android Studio to let you reuse code from your mobile app.
Create a Wear OS module in your existing project
To create a Wear OS module, open your existing Android Studio project and do the following:
- Click File > New > New Module.
- In the New Module window, select Wear OS Module and click Next.
- Under Configure the new module, enter the following:
- Application/Library Name: the title of your app launcher icon for the new module
- Module Name: the name of the folder for your source code and resource files
- Package Name: the namespace for the code
in your module. The string is added as the
package
attribute in the module's Android manifest file. - 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 thebuild.gradle
file, which you can edit later.
- Click Next. You see multiple code template options. Select Blank Wear OS Activity and then click Next.
- In the Configure Activity window, enter or accept the default values for the Activity Name, Layout Name, and Source Language. Click Finish.
Android Studio creates and syncs the files for the new module. Android Studio also adds any required dependencies for Wear OS to the new module's build file. The new module appears in the Project window on the left side of the screen. If you don't see the new module's folder, make sure the window is displaying the Android view.
Include the following in the build.gradle
file for the new Wear OS module:
-
In the
android
section, set the values forcompileSdkVersion
to 33 andtargetSdkVersion
to 30. - Add the dependencies you need. For more information, see Declaring dependencies.
- Sync your Android Studio project. To run the code in the new module, see Launch the emulator and run your Wear OS app.