2

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?

Yingding Wang
  • 450
  • 3
  • 14

1 Answers1

0

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

Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69
  • 1
    thanks for the hints. It does help me found out, that I have wrongly set the package to be my app for the intent. Do you know why the putExtra option to scroll to certain watchface with `new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER) .putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, yourWatchFace)` doesn't work anymore. I can now open the wall paper chooser, but then it just scroll down and then up to the first watchface, not to my desired watchface. – Yingding Wang Aug 12 '22 at 09:59
  • No, sorry, I have no idea. – Yuri Schimke Aug 14 '22 at 10:17