Android Genymotion Mock Location Google Play

To get Android Genymotion Mock Location Google Play fused location provider working in an emulator these are the necessary components and steps.  (For Genymotion 2.5.x emulator versions)

Download:

Steps

  1. Install these two zipped APK archive files by dragging the zip files directly onto your running Genymotion Emulator in order.  Start first with ARM Translation v1.1.  It will ask for confirmation.  Click OK.
    Install genymotion ARM Translation v1.1
  2. After the APK file is unpacked and installed, genymotion emulator will ask to restart.  To restart your genymotion emulator, in a command prompt on your computer, issue an emulator reboot command: adb reboot.  The emulator will reboot several times. For me: 4 times it will cycle before settling down and showing the home screen.
  3. Repeat with the Google Apps Play Store file (gapps-5.1-xxxxx) file –  drag and drop, confirm install, adb reboot.  This should only cycle off/on your emulator once, unlike the ARM Translation APK you installed earlier.
  4. Click on the Home button (center white circle with dots at bottom) and find Google Play Store.  Click it to start Google Play.  It may ask to update.  If so, update it.
    genymotion-playstore-installed
  5. Open Google Play. It will ask for a Google account.  Feel free to create a new one or use one you already have.  Supply its password.  Accept Terms of Service and Privacy Policy.  Google Play Services may pop up a dialog saying it has stopped.  Google Play setup will continue though.  Setup payment info if you like.  I didn’t and chose Remind me later.  After that you’ll be shown the Play Store home page.
    google_play_setup_account
  6. Google Play Store in Genymotion crashes repeatedly after install on a Genymotion emulator.  To fix the Google Play Store crashes on Genymotion emulator, open the Settings application in Android (gear icon), scroll down and click on Apps.  Click on Google Play Store.  Click on Clear Cache and Clear Data.  Click OK on any dialogs that come up.
    genymotion_settings
    settings_apps_downloaded
    settings_apps_clear_cache_clear_data
    1. Restart Google Play
    2. Accept Terms and Conditions again
    3. You may or may not have to log in again.  If you get an error regarding you must be logged in when trying to search for Maps, click on the three horizontal bars at the top left of the Google Play home screen to slide out the left tray and click My Account.  Log in if asked to do so.  For me it auto-logged me in from cached credentials.
      google_play_my_account
    4. Back in Google Play, text search for maps.  Google Play should not crash.
  7. Install Google Maps.
    google_play_store_google_maps
  8. In Google Play, find and install a mock location provider such as Mock Locations or Fake GPS.  Mock Locations (fake GPS path), which allows you to draw out a path which you can “drive” or “walk” at your desired speed between locations of your choice.  I find this quite useful when using GoogleApiClient fused provider where requestLocationUpdates is returning Location objects repeatedly over a period.  Very helpful when you’re testing Entering and Exiting GeoFences
    mock_location
  9. Don’t forgot to turn on High Accuracy mode in Settings -> Location -> Mode -> High accuracy, which allows GoogleAPIClient Location Services fused location provider to work properly.  I didn’t have much luck running Google Play Services Location Provider with GPS (Device) only Location setting.
    location_mode
  10. And finally Dev Tools (application on Genymotion) -> Developer Options -> Allow Mock Locations needs to be On.
    dev_options_app_icon_highlighted
    dev_options_mock_locations

 


Posted

in

,

by