简体   繁体   中英

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.

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

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

What problems you have with testing WearableListenerService anyway? 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 -s <wearable_id> install <path_to_apk>
You can retreive the ID of your device once connected to adb (via Bluetooth debugging) with
adb devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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