Skip to content

Most visited

Recently visited


Creating and Running a Wearable App

This lesson describes how to start developing a wearable app, which runs directly on a watch. A wearable (watch) app can access low-level hardware such as sensors, activities, services, and more. Also see Standalone Apps and Using the Wear UI Library.

To test your app with a companion (paired) phone, install the latest version of the Wear companion app on that phone.

Note: Using the Android watch emulator has benefits such as testing your app with different screen shapes. However, to better evaluate the total user experience, we recommend that you develop on actual hardware. You can test your app with the Android debugger by connecting it to a watch via Wi-Fi or Bluetooth.

Setting Up a Development Environment

To begin, install the latest version of Android Studio.

Use the SDK manager to install or confirm that you have the latest versions of the following:

Also see Update the IDE and SDK Tools.

Note: If you plan to make your Wear apps available for China, see Creating Android Wear Apps for China.

Creating or Updating a Project

Many features in Android Studio are available for developing your app. For an overview and links to more information, see Meet Android Studio. For detailed information about projects in Android Studio, see Projects Overview.

Create a sample project

To create a sample project for development in Android Studio:

  1. Click File > New > New Project.
  2. On the Configure your new project screen, accept the default values and click Next.
  3. On the Target Android Devices screen, optionally select the Phone and Tablet option. If you plan to use Android 7.1.1 APIs in a phone app, then the Minimum SDK option list, select API 25: Android 7.1.1 (Nougat).
  4. On the same Target Android Devices screen, select the Wear option, and in the Minimum SDK option list, select the latest available option, such as API 25: Android 7.1.1 (Nougat).
  5. Click Next until the Add an Activity to Wear screen is displayed.
  6. On the Add an Activity to Wear screen, select Blank Wear Activity and click Next.
  7. On the Customize the Activity screen, click Finish. Android Studio creates your project
  8. In the build.gradle file for the Wear module:
    • In the android section, confirm that the compileSdkVersion is set to 26.
    • In the android section, confirm that the targetSdkVersion is set to 26.
    • Update the dependencies section (requires the latest version of the Google Repository). The first dependency is for the Wear UI Library, which has classes that exemplify best practices. The second dependency is for the Wearable Support Library, which has additional classes (including for watch faces):
      compile ''
      compile ''
      provided ''
  9. In the build.gradle file for the entire project, add Google's Maven repository. Specifically, in the repositories section, add a maven section with the "" endpoint:
      allprojects {
          repositories {
              maven {
                  url ""

Update an existing project

To update an existing project for development:

  1. Start Android Studio, click Open an existing Android Studio Project, and select a project.
  2. If prompted by the Android SDK Manager for the SDK version to use for the project, select Use Android Studio's SDK.
  3. If prompted to update the Gradle plugin, update the version of the plugin.
  4. In the build.gradle file for the Wear module:
    • In the android section, update the compileSdkVersion to 26.
    • In the android section, update the targetSdkVersion to 26.
    • Update the dependencies section as follows (requires the latest version of the Google Repository):
      compile ''
      compile ''
      provided ''
  5. In the build.gradle file for the entire project, add Google's Maven repository. Specifically, in the repositories section, add a maven section with the "" endpoint:
      allprojects {
          repositories {
              maven {
                  url ""

Setting Up a Watch

After you enable adb debugging, you can use a watch during development.

Enable adb debugging on the watch:

  1. Open the Settings menu on the watch.
  2. Scroll to the bottom of the menu. If no Developer Options item is provided, tap System and then About.
  3. Tap the build number 7 times.
  4. From the Settings menu, tap Developer Options.
  5. Enable ADB debugging.

Connect the watch:

  1. Connect the watch to your machine through USB, so you can install apps directly to the watch. A message appears on both the watch and the Android Wear app prompting you to allow debugging. Alternatively, connect the watch to your machine over Wi-Fi; for more information, see Debugging over Wi-Fi.
  2. On the Android Wear app, tap Always allow from this computer and tap OK.

After you follow the instructions in Setting Up a Phone, you can run your app as follows:

  1. Open your app in Android Studio.
  2. Select your Wear app module name from the Run/Debug configuration drop-down menu (typically wear).
  3. Click the Play button.
  4. In the Select Deployment Target box, click your device.

After your app is installed on the watch, the app should run.

Setting Up an Emulator

To use the Android Emulator, confirm that you have the latest version of the Android SDK Platform-tools from the SDK Manager.

Create and run a virtual device in Android Studio as follows:

  1. Open the AVD Manager by selecting Tools > Android > AVD Manager.
  2. Click Create Virtual Device.
  3. In the Category pane, select Wear and choose a hardware profile. Click Next.
  4. Select a Nougat image to download. For example, select the image with the Release Name of Nougat, the API Level of 25, and the Target of "Android 7.1.1 (with Android Wear)". When the download and installation are complete, click Finish and then click Next.
  5. Verify the configuration of the Android Virtual Device (AVD) and click Finish. You may be prompted to accept necessary updates for the AVD.
  6. Start the emulator by clicking the Play button, selecting the new virtual device, and waiting until the emulator initializes and shows the Android Wear home screen.

Pair the phone with the emulator and sync a Google Account, as follows:

  1. Follow the steps for setting up a phone.
  2. On the phone, enable Developer Options and USB Debugging.
  3. Connect the phone to your computer through USB.
  4. Forward the AVD's communication port to the connected handheld device (each time the phone is connected):
    adb -d forward tcp:5601 tcp:5601
  5. On the phone, in the Android Wear app, 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, in the upper-left drop-down, tap Add a New Watch.
  6. On the phone, in the Android Wear app, tap the Overflow button, and then tap Pair with Emulator.
  7. Tap the Settings icon.
  8. Under Device Settings, tap Emulator.
  9. Tap Accounts and select a Google Account, and 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.

For more information about using virtual devices, see Run Apps on the Android Emulator.

Setting Up a Phone

This section contains information about setting up a companion phone with an Android Wear companion app.

Wear apps can be standalone, and work independently of a phone. However, if your app depends on a phone app, see the information below about updating a phone with the latest Android Wear companion app for use in development.

Using the Android version of the companion app

On an Android phone, go to the Android Wear app listing. Tap Update to download and install the app. After installation, confirm that Auto-update is selected for the app (see the "Set up automatic updates for specific apps" 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 ("Forget") any obsolete watch pairings, if necessary. Then you can pair the phone to a newly-imaged watch:

  1. On the phone, select your device name from the list of devices. A pairing code is displayed on the phone and on the watch. Ensure that the codes match.
  2. Tap Pair to continue the pairing process. When the watch is connected to the phone, a confirmation message is displayed. On the phone, a screen is displayed that lists the accounts on the phone.
  3. Choose a Google Account to add and sync to your watch.
  4. Confirm the screen lock and enter the password to start the copying of the account from the phone to the watch.
  5. Follow the instructions in the wizard to finish the pairing process.

Companion app for iPhones

An iOS companion app is available but the phone on which the app is installed must be running iOS 8.2 or higher:

  1. On your iPhone, visit the App Store and download the Android Wear app. Install the app on your iPhone.
  2. Follow the instructions on the watch and on the phone to begin the pairing process. For additional information, see the related Help page.

Running an App

After you complete the steps to create a sample project and you have set up a watch or an emulator, you can use the Play button in Android Studio (or use adb install) to run the "Hello World" sample activity in the wear module of the project you created.

Specifically, in your Android Studio project, select wear from the Run/Debug configuration drop-down menu and click the Play button. The activity will print "Hello world!"

Including Libraries

When you use Android Studio's Project Wizard, the wizard imports dependencies in the appropriate module's build.gradle file. However, the dependencies are not required for all apps; please review the information below about the dependencies.


For information about dependencies for notifications, see Creating a Notification for Wearables.

Wear UI Library

The components in the Wear UI Library are recommended because they exemplify best practices for watch apps. Therefore, it is recommended that you add a dependency on the Android Support Library. For more information, see the following pages:

Wearable Support Library

The Wearable Support Library has UI components for watch apps. Some of its classes are deprecated. For information about the classes that replace the deprecated ones, see Using the Wear UI Library.

Although the UI components can change at any time, a change in a component doesn't cause an app to break (because the components are compiled into your app). To get new features from an updated library, statically link the new library version and update your app accordingly.

Wearable Data Layer APIs

To sync and send data between watches and phones with the Wearable Data Layer APIs, you need the latest version of Google Play Services. If you are not using these APIs, remove the dependency from both modules.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.