Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Wear OS preview setup

For basic compatibility testing, you can use your current APK and a supported watch or an emulator.

You don't necessarily need to update your full development environment for basic testing. To simply test your app's compatibility with a preview system image, see Wear OS preview downloads.

However, to develop apps, you need to update your development environment, as described below.

Install Android Studio and the latest packages

  1. For compatibility with Android P, install the latest version of Android Studio.
  2. Use the SDK manager to install or confirm that you have the latest installations of the following package:
    • Under the SDK Platforms tab: Android P

Update or create a project

To use the APIs, your project must be configured appropriately in Android Studio.

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 'android-P'.
    • In the android section, update the targetSdkVersion to 'P'.
    • In the dependencies section, update the existing reference to the Wearable Support Library by changing it to the following: compile 'com.google.android.support:wearable:2.3.0'

      This requires that the installed Google Repository is the latest version.

  5. See the instructions at Wear OS preview downloads for setting up a watch or emulator with the preview system image, in order to begin testing your app.

Create a new project

To create a new project for development:

  1. Click File > New Project and follow the steps in the Create New Project wizard until you reach the Target Android Devices page.
  2. Optionally, select the Phone and Tablet option. If you plan to use Android P APIs in a phone app, then the Minimum SDK option list, select API P.
  3. Select the Wear option, and in the Minimum SDK option list, select the latest available (API P) option. Click Next until you exit the Create New Project wizard.
  4. In the build.gradle file for the Wear module:
    • In the android section, update the compileSdkVersion to 'android-P'.
    • In the android section, update the targetSdkVersion to 'P'.
    • In the dependencies section, update the existing reference to the Wearable Support Library by changing it to the following: compile 'com.google.android.support:wearable:2.3.0'

      This requires that the installed Google Repository is the latest version.

  5. See the instructions at Wear OS preview downloads for setting up a watch or emulator with the preview system image, in order to begin testing your app.