Search code examples
javaandroidwear-oswatchface

Packaging and installing Android Wear Watchface


I've read several other questions regarding this same topic however I am still at my wit's end trying to figure out how to get my Watchface to appear on my Android Wear device, let alone publish it to the Play Store.

The project has a mobile app which houses a blank activity and then the Wear app (Watchface) which houses the activity for the Watchface. I've attempted the following

  • signing both Wear and mobile apks and installing then both on my phone (mobile app shows with blank activity but no Wear Watchface available on watch)

  • installing the signed Wear apk separately (also does not display as a selectable Watchface)

  • running the Wear Watchface in the Android Studio emulator (works)

  • making sure that the same permissions exist in both mobile and Wear manifests

  • ensuring that all project IDs match up and are the same

Any advice or help would be great.


Solution

  • After much digging, I was able to get to the solution.

    In order for a watch face or a wear apk to be moved on the watch for debugging purposes, one must ensure the following

    1. Ensure all of these items are met in addition to the following.
    2. Turn on debugging in both the Android Wear application as well as on the watch itself. (Debugging on the watch can be turned on by enabling developer options by tapping the build number) You would want to enable debugging over bluetooth
    3. Your phone should also be plugged into to a computer that has adb and enable adb debugging on the device itself.
    4. Typing adb-devices in Command Prompt will list all of the devices found
    5. Connect the debugger to the watch by adb forward tcp:4444 localabstract:/adb-hub adb connect 127.0.0.1:4444
    6. Ensure that both target and Host are connected by opening the Android Wear companion app, tap settings and viewing the status message that appears under the bluetooth debugging toggle option. It should read Host: connected Target: connected
    7. adb-devices should now show both the phone and the watch. From here on you can use adb commands to push the wear apk to the watch.

    Source