How do I change Watch Faces on Wear OS 3.2 programmatically

305 Views Asked by At

I was able to change the WatchFace programmatically with Action WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER on Wear OS 2 (https://stackoverflow.com/a/29786902/3569768), but with the Wear OS 3 emulator I got the error

No Activity found to handle Intent { act=android.service.wallpaper.CHANGE_LIVE_WALLPAPER (has extras) }

How can I change the WatchFace programmatically on Wear OS 3.2?

1

There are 1 best solutions below

2
On

For development purposes you can use surface launching.

$ adb shell am broadcast -a com.google.android.wearable.app.DEBUG_SURFACE --es operation set-watchface --ecn component com.example.android.wearable.alpha/com.example.android.wearable.alpha.AnalogWatchFaceService

$ adb shell am broadcast -a com.google.android.wearable.app.DEBUG_SYSUI --es operation show-watchface 

See here for commands https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:deploy/deployer/src/main/java/com/android/tools/deployer/model/component/WatchFace.java?q=show-watchface