通过移动应用程序连接进行 WearOS 应用程序调试

发布于 2025-01-19 20:10:15 字数 441 浏览 1 评论 0原文

我创建了一个Android应用程序,其中包含一个磨损模块。当我通过USB在物理设备上运行移动应用程序调试器时,我发现它不会包装磨损应用程序,因此我无法在手表上安装链接的手表应用程序(通过Wi-Fi通过ADB链接)。在运行移动设备调试器时,我运行了Watch App的调试器,并且该应用程序在手表上运行,但是我在移动应用程序中有代码可以检测手表何时连接,并且它永远不会连接。当我通过“手机上的应用程序”菜单上安装手表应用程序时,该应用程序发布时可起作用,并且在发布手表应用程序时就建立了手表连接性。

如何通过调试器实现手表和电话应用之间的连接性?这对我来说是一个巨大的疼痛点,我似乎无法在Google或Stackoverflow上找到任何东西,这些内容描述了如何最好地设置调试环境,以便将这些应用程序链接在2个设备上并可以进行通信。 我的移动设备应用在很大程度上取决于检测手表传感器并与它们进行交互,因此我需要一种有效的方法来测试它。

谢谢!

I've created an android application, with a wear module contained within it. When I run the mobile application debugger on a physical device through USB, I see it doesn't package the wear application with it and so I cannot install the linked watch application on my watch (which is linked through ADB over wi-fi). While the mobile device debugger is running, I run the debugger for the watch app and the app runs on the watch, but I have code in the mobile app to detect when the watch is connected and it never does connect. The app works though when it is published and the watch connectivity is established when I install the watch app through the 'apps on your phone' menu on my watch.

How can I achieve the connectivity between the watch and phone apps through the debugger? This is a massive pain point for me and I can't seem to find anything on google or stackoverflow that describes how best to set up debug environments so that these apps are linked on the 2 devices and can communicate.
My mobile device app is heavily dependent on detecting watch sensors and interacting with them and so I need an efficient way to test this.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2025-01-26 20:10:15

您是在本地使用模拟器还是在同一设备上进行测试?

如果您在相同的设备上进行测试,请注意,只有当包和签名都匹配时,Wear 连接才起作用。调试版本具有与发布版本不同的签名是标准的。因此,只有手表应用程序的调试版本可以与手机应用程序的调试版本进行通信。

Are you using emulators locally or testing on the same devices?

If you are testing on the same devices, be aware that Wear connectivity only works when the package and signature both match. It is standard for debug builds to have a different signature than a release build. So only the debug build of the watch app can talk to the debug build of the phone app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文