Search code examples
androidgenymotion

Can I open a Genymotion device from a terminal command?


When I begin my Android development I always go through the same process of opening Genymotion, then selecting a virtual device with the mouse then clicking start.

I would like to script this so I can just open the virtual device from the termainal. Is there a way to do this?


Solution

  • This question has been asked before, and here is it's accepted Answer.

    For others looking for non-headless command line startup:

    /Applications/Genymotion.app/Contents/MacOS/player --vm-name "xxxx" Get a list of vms:

    $ VBoxManage list vms "Galaxy Nexus - 4.2.2 - API 17 - 720x1280" {56d8e3aa-ecf8-483e-a450-86c8cdcedd35}

    Where xxxx can be either the name or the id:

    /Applications/Genymotion.app/Contents/MacOS/player --vm-name 56d8e3aa-ecf8-483e-a450-86c8cdcedd35 /Applications/Genymotion.app/Contents/MacOS/player --vm-name "Galaxy Nexus - 4.2.2 - API 17 - 720x1280"

    You can kill it with a normal process kill:

    ps | grep "Genymotion\.app/Contents/MacOS/player" | awk '{print $1}' | xargs kill

    UPDATE

    Since Genymotion 2.5.0 you can manage all your Genymotion devices thanks to a command line tool. With this tool you can create, start, stop, delete, push files, flash the device, ... Here is a simple example to create a device and start it:

    gmtool admin create "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920" myNexus
    gmtool admin start myNexus
    

    This feature is available for paid licenses.

    Reference Link:
    https://www.genymotion.com/#!/support?chapter=start-virtual-devices-command-prompt#faq