MAG
MAG

Reputation: 3075

ddms seems to be disabled for genymotion in android studio

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.

Upvotes: 0

Views: 997

Answers (1)

eyal-lezmy
eyal-lezmy

Reputation: 7116

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

Upvotes: 3

Related Questions