Android wearable - 如何自动安装可穿戴应用

Android wearable - how to auto install wearable app

我在 android 项目中创建了两个简单的模块。一个模块称为 handHeld,另一个模块称为 wearable。在 handHeld 的清单中,我将 wearable 设置为依赖项(系统已经为我设置了它)。我期待当我将 handHeld 加载到设备上时,它会自动将可穿戴设备同步到手表上,但我在模拟器上看不到它(在执行端口 fwd 之后)。手表和设备之间的通信正常,因为我可以看到出现和同步的通知。我怎样才能让我的可穿戴应用程序在我将 handHeld 模块安装到我的设备上的同时加载到手表上?

它只会自动安装使用发布密钥库签名的应用程序,如果您正在构建调试版本,则需要使用 adb 手动将其添加到您的手表。

Note: The automatic installation of wearable apps does not work when you are signing apps with a debug key and only works with release keys. See Packaging Wearable Apps for complete information on how to properly package wearable apps.

https://developer.android.com/training/wearables/apps/creating.html