Using Genymotion android emulator with Meteor

This is very important.

Cordova sees emulators as real devices so any commands you use must be as though you are connecting to a physical device.

This command will load your android app into your Genymotion instance and point it to your local IP. (substitute your own LAN IP in your case).

meteor run android-device –mobile-server=http://192.168.1.x:3000

OR

meteor run android-device

Running multiple instances

Initially you may only have one instance running at a time.To work around this minor limitation you can load your app on many emulated instances and then turn them all on concurrently to simulate multiple cordova users.

Within your meteor project root directory using this command line to deploy more instances:

.meteor/local/cordova-build/platforms/android/cordova/run

This will install the compiled app onto the device that is connected. Repeat for each device.

Then you can run a development instance of meteor with a mobile-server that all the clients will be connected.

Whenever you want to test, open up  your instances and fire up a meteor server instance.

meteor run android-device

Tips on running more than one emulator concurrently:

https://github.com/meteor/mobile-packages/issues/55

Troubleshooting:

Ensure you have USB debugging enabled

Ensure that you can connect to your instance using ADB

Ensure that you your device shows up as connected via ADB, check with ‘adb devices’ and ‘adb connect IP’

Ensure that you are using the latest version of ADB 1.0.32 (verify with ‘adb version’ in command line)

Ensure that you have configured Genymotion to use the same ADB as your system instance.

Other reading:

http://stackoverflow.com/questions/26918902/stuck-on-meteor-example-todos-loading-screen-when-running-on-an-android-device

Adding Google Apps (gapps) to Genymotion 2.6 +

Follow this instructional video.

https://www.youtube.com/watch?v=Jbu8WT-naW4

Grab the Gapps signed packages here

https://androidmtk.com/download-gapps

Tested April 2016

 

Alt solution, (untested)

1) genymotion 2.6.0
2) device emulator PREVIEW – Google Nexus 5X – 6.0.0 – API 23 – 1080×1920
3) flash Genymotion-ARM-Translation_v1.1.zip then restart.
4) flash gapps-L-4-21-15.zip. (https://www.androidfilehost.com/?fid=96042739161891406)
5) sign in into your google account.
6) flash ( benzo-gapps-M-20151011-signed-chroma-r3.zip) https://www.androidfilehost.com/?fid=24052804347835438 and restart.

 

Alt solution, tested

  1. Install a latest Genymotion (version 2.6.0 in my case). Make sure the previous old (preview) Android 6.0 images are removed (Genymotion -> Settings -> Misc -> Clear cache).
  2. Add a new virtual device, select Google Nexus 5X and Android 6.0 image. It should download a new image from Genymotion website.
  3. Start created Google Nexus 5X – 6.0.0 – API 23 – 1080×1920 virtual device.
  4. Flash Genymotion-ARM-Translation_v1.1.zip (drag&drop the zip file to virtual device window) and then restart the virtual device.
  5. Flash gapps-L-4-21-15.zip and restart the virtual device again.
  6. Now add Google account in the virtual device via Settings -> Accounts -> Add account. 
  7. Do not start Google Play! Ignore any crashes in sign in process.
  8. Flash benzo-gapps-M-20151011-signed-chroma-r3.zip and restart the virtual device.
  9. Open Google Play in virtual device, update all installed applications.
  10. Now the device is prepared with working Google Play and Google Play Services.

 

Alt downloads for Gapps

http://androiding.how/android-6-0-marshmallow-gapps/

 

Notes: It seems you cannot use the open_gapps packages as they are not signed. Perhaps there’s a workaround but the method above works out of the box.

References:

https://gist.github.com/wbroek/9321145