Working with Genymotion and Android Wear

Google has released the Android Wear Developer Preview, which includes tools and APIs that allow developers to enhance their app notifications to provide an optimized user experience on Android wearable devices. The drawback is that the preview is compatible with Android 4.3 and higher and is also not available for the Android emulator. This is a problem for developers who don’t have a device running Android 4.3 or higher. However, with Genymotion you can overcome this problem and start to test the notifications on the Android Wear emulator.

  1. Download Genymotion for free here.
  2. Setup a Nexus 4 or Nexus 5 virtual device in Genymotion.
    • Make sure you install Google Play Services on the Nexus device:
      • Download the zip file
      • Drag it into the Nexus device
      • Reboot the device
  3. Download the “Android Wear Preview” app.
  4. Setup the Android Wear emulator – follow the instructions given here.
  5. Start both the Nexus and Android Wear emulator.
    Android Wear Emulator
  6. Open the terminal or command prompt. Change your path to the platform-tools directory or execute this:
    \path\to\adt-bundle\sdk\platform-tools\adb.exe devices
    

    This will show you the devices/emulators that are currently running

  7. Execute this command to install the “Android Wear Preview” app on the Nexus emulator:
    \path\to\adt-bundle\sdk\platform-tools\adb.exe -s [device name Nexus] install WearablePreview.apk 
  8. Execute this command to forward port 5601 from the Nexus emulator, to receive the notifications on the Wear emulator:
    \path\to\adt-bundle\sdk\platform-tools\adb.exe -s [device name Nexus] forward tcp:5601 tcp:5601
  9. Open the “Android Wear Preview” app on the Nexus device and Connect.
  10. All done! You have now connected both the emulators and notifications should instantly start to appear on the Wear emulator.

[via]