0

I am on mac . I started my genymotion emulator and then via android studio started ddms . enter image description here

Kindly note that the send button in location control is not clickable . If do not use genymotion emulator and use directly the emulator from android studio the button is not disabled and works fine .

Do I need to do some steps before using ddms for genymotion emulator in android studio.

MAG
  • 2,841
  • 6
  • 27
  • 47

1 Answers1

3

Genymotion's fake GPS positions cannot be controlled from DDMS. There are several other ways to do it:

  • The UI widget. You can open the widget by clicking on the GPS icon on the right of the device

It allows you to send mock data to the device (lat, long, altitude, accuracy and bearing). You can also open a GoogleMap view to choose your location more easily.

enter image description here

  • The Java API

You can control the GPS position of a device directly from your instrumented tests by usgin the Java API. This API gives you the same level of control than the UI widget. You can find more information on the documentation.

Here is basically how to get it:

GenymotionManager genymotion = GenymotionManager.getGenymotionManager(ctx);
genymotion.getGps()
        .setLatitude(64.13367829)
        .setLongitude(-21.8964386);

You can find a full sample on Github

  • The Command line (genyshell)

You can launch the genymotion console, connect to a specific device and then send commands to fully control the GPS. You can find more information on the genyshell documentation

eyal-lezmy
  • 7,090
  • 3
  • 41
  • 35
  • will i be able to run gpx files as well just like in ddms ? – MAG Jul 01 '15 at 05:31
  • Unfortunately nope. But I think you can easily use the command line to script a route. It's not as simple as a gpx files but still feasible. – eyal-lezmy Jul 01 '15 at 08:23