简体   繁体   中英

Trouble running android wear app on emulator

I cannot seem to run this application which is supposedly ready to go to run on the Android Wear emulator.

Appreciate if someone can help me as to why this app does not actually get deployed to Watch emulator. I can see that the unaligned APK gets generated though.

I am following this guide: http://toastdroid.com/2014/07/18/developing-watchfaces-for-android-wear/

Code is available at: https://github.com/twotoasters/watchface-template

To install watchface you need to generate signed APK and push it to phone that is connected to that emulator, and install it there. After 1-2 minutes watchface should appear on the Wear device - if doesn't sync apps by companion app.

Also make sure that package for phone contains 'wear' part.

The key here is that you're using the emulator. If you run WatchfaceActivity.java from the Wear module on the emulator, you will see the watch appear on screen, but as an activity that can be dismissed.

If you then try to select it as the default watch face, you will be met with a black screen. I have only seen the emulator display the custom watch face (as a watch face, not a running activity) once and it seemed to have been a fluke.

The best way to develop custom watch faces is to run them as stand alone activities until it appears to be done, then go through the trouble of exporting a signed APK and run it on a real device connected to a real watch. At that point you can fix any small issues that remain.

please run you application on phone which has 4.3 or above platform.

install Android wear launcher apk on phone .

then connect wear emulator and phone using adb command.

adb -d forward tcp:5601 tcp:5601

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