简体   繁体   English

如何在Android Studio中调试WearableListenerService?

[英]How can I debug a WearableListenerService in Android Studio?

I can only deploy either the wearable app, or the mobile app, to my devices. 我只能将可穿戴式应用程序或移动应用程序部署到我的设备上。 Is there a way to deploy both at the same time while debugging? 有没有一种方法可以在调试时同时部署两者? It's very difficult to debug a WearableListenerService otherwise. 否则,调试WearableListenerService非常困难。

You can try to build you app using release keys. 您可以尝试使用释放键来构建您的应用程序。

When you're ready to publish your app to users, you embed the wearable app inside of the handheld app. 当您准备将应用发布给用户时,可以将可穿戴应用嵌入到手持应用中。 When users install the handheld app from Google Play, a connected wearable automatically receives the wearable app 当用户从Google Play安装手持应用时,已连接的可穿戴设备会自动接收可穿戴应用

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

What problems you have with testing WearableListenerService anyway? 无论如何,您在测试WearableListenerService时遇到什么问题? Works fine for me even if I install apps separately. 即使我单独安装应用程序,也可以正常工作。

You can try uploading and installing your Wear App from console line using adb : 您可以尝试使用adb从控制台行上载和安装Wear App:
adb -s <wearable_id> install <path_to_apk>
You can retreive the ID of your device once connected to adb (via Bluetooth debugging) with 一旦连接到adb(通过蓝牙调试),您就可以获取设备的ID。
adb devices

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM