5

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?

ooolala
  • 1,235
  • 1
  • 14
  • 20
  • Not sure who down-voted this or why. It would have been nice to leave a comment explaining why. This seems like a perfectly valid question to me. – EJK Dec 09 '14 at 04:58
  • check out here. http://stackoverflow.com/questions/18768489/how-to-start-genymotion-device-with-shell-command – bjiang Dec 09 '14 at 04:58
  • @EJK: SO forums seem to have quite a few nitwits lately who would just downvote without giving the OP a chance to ask the question. Instead of downvoting, just close or move the question if it's off-topic. Anyway, the question asked by **ooolala** is quite valid and on-topic. – ChuongPham Dec 09 '14 at 05:05
  • possible duplicate of [How can I script genymotion emulator to launch a given avd, headless?](http://stackoverflow.com/questions/18396344/how-can-i-script-genymotion-emulator-to-launch-a-given-avd-headless) – Salman Khakwani Dec 09 '14 at 05:40
  • I did do some searching beforehand, but didn't see the answer I was looking for. Thanks for linking it in, this will work nicely. – ooolala Dec 10 '14 at 04:49
  • This isn't working with the latest version of Genymotion. – ooolala Dec 11 '15 at 05:13

1 Answers1

2

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

Community
  • 1
  • 1
Salman Khakwani
  • 6,484
  • 7
  • 30
  • 56
  • This isn't working with the latest version of Genymotion. This question is answered here: http://stackoverflow.com/questions/18768489/how-to-start-genymotion-device-with-shell-command – ooolala Dec 11 '15 at 05:19
  • 1
    Thanks for Pointing this out, I have updated my Answer. – Salman Khakwani Dec 11 '15 at 05:30