Android Wear generate two apk

我怕爱的太早我们不能终老 提交于 2019-11-29 09:18:18

There are two apks because (for debugging/testing) you can (and should) install the wear apk directy on the Android Wear device.

However, when you are going to publish the "Android Wear-ready" app to the Play Store, you should only upload the mobile apk. The other apk is embedded within, and will be automatically pushed to the connected watch.

See Install the Wearable app in the documentation:

When developing, you install apps directly to the wearable like with handheld apps. Use either adb install or the Play button on Android Studio.

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.

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.

Two APKs is exactly what is expected: the wear APK is then embedded into the mobile APK as per the packaging Wear apps training. In release builds, the wear APK is then auto-installed onto the user's Android Wear device. However, as per the note on the packaging page:

This feature doesn't work when you are signing your apps with a debug key when developing. While developing, installing apps with adb install or Android Studio directly to the wearable is required.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!