Android Studio. Simulate multiple GPS points with Mock Location Plugin

If you develope an Android app with Android Studio you can send one GPS position using the Android Device Emulator.

Android-Studio-Android-Device-Monitor-01

Once you have launched the app you are developing in the Android emulator, you have to launch the Android Device Emulator, insert both location points (longitude and latitude) and press the “Send” button. Then your app will receive this coordinate, simulating the Android GPS

Android-Studio-Android-Device-Monitor-02

But if you want to simulate a route made with your device, with a lot of coordinates, you have to install one plugin, in particular the “Mock Location Plugin” for Android Studio.

First, you have to install the plugin in Android Studio.

You have to go to “Settings…”

Android-Studio-Mock-Location-Plugin-01

Then you have to click on “Plugins”, insert the text “gps emulator” in the search box and click on the “Browse” link.

Android-Studio-Mock-Location-Plugin-02

Then you have to click on the “Gps Emulator” plugin and click on the “Install plugin” button.

Android-Studio-Mock-Location-Plugin-03

You have to confirm the download and installation process.

Android-Studio-Mock-Location-Plugin-04

And then you have to restart the “Android Studio” clicking on the “Restart Android Studio” button.

Android-Studio-Mock-Location-Plugin-05

You have to confirm the restart clicking on the “Restart” button.

Android-Studio-Mock-Location-Plugin-06

Now you have the plugin installed in the Android Studio.

Once you have launched the app you are developing in the Android emulator, you have to launch the “Gps Emulator”.

Android-Studio-Mock-Location-Plugin-07

Then you have to configure:

  • The “Start Location” (latitude and longitude).
  • The “End Location” (latitude and longitude).
  • The “Steps”: the number of emulated coordinates that the plugin will send to your app.
  • The “Time Between Steps”.

And you have to clic in the “Start GPS Emulation” button to start sendind the emulated coordinates.

Android-Studio-Mock-Location-Plugin-08

 

Android-Studio-Mock-Location-Plugin-09

 

 

Comments

11 responses to “Android Studio. Simulate multiple GPS points with Mock Location Plugin”

  1. rouk Avatar
    rouk

    thank you for this help, merci beaucoup

  2. Ricardo Avatar
    Ricardo

    Gracias, la he empezado a usar hoy y es muy útil.

  3. awana mayela Avatar
    awana mayela

    thank!

  4. Fandi Akhmad Avatar
    Fandi Akhmad

    thank you!

  5. GN Avatar
    GN

    Nice post!

  6. matt Avatar
    matt

    i got this error
    “couldnt connect to android emulator, make sure an emulator is running on the specific port”

  7. moyamo Avatar
    moyamo

    Same error

  8. Reta kebede Avatar
    Reta kebede

    thanks for such kinds of help.

  9. Luke Avatar
    Luke

    Downloading doesn’t work right now:
    Plugin Gps Emulator was not installed: Cannot download ‘[repository link here]’: Read timed out

  10. [Solved] How to emulate GPS location in the Android Emulator?

    […] There is a plugin for Android Studio called “Mock Location Plugin”. You can emulate multiple points with this plugin. You can find a detailed manual of use in this link: Android Studio. Simulate multiple GPS points with Mock Location Plugin […]

  11. […] There is a plugin for Android Studio called “Mock Location Plugin”. You can emulate multiple points with this plugin. You can find a detailed manual of use in this link: Android Studio. Simulate multiple GPS points with Mock Location Plugin […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.