0

Is it possible for this setting to work?

1) Ubuntu 14 with Jenkins, Genymotion, and Virtual Box installed

2) The job inside Jenkins will restore and run Genymotion from a command line following this tutorial: http://blog.genymobile.com/genymotion-jenkins-android-testing/

From my Mac, I tried to access the Jenkins website and run the build. Firstly, Genymotion failed because it couldn't "connect to X server". So, I installed Xvnc Plugin on Jenkins which solved the error. Unfortunately, Genymotion still failed to start up with the error "Cannot get IP address".

Please note that I only have "ssh -X" access to the server. I can manually start up Genymotion but the process was terminated when I logged off. As a result, I could not leave the GenyMotion run on the Server as suggested by this solution: Jenkins - Use Genymotion VM instead of Android Emulator

Any advice?

Community
  • 1
  • 1
SPK
  • 38
  • 4

2 Answers2

0

Here is the way to make Genymotion works on a continuous integration server.

  1. First, the computer running Genymotion needs to respect the hardware requirements
  2. You won't be able to run Genymotion if you don't have an X server running.

I don't think xVNC supports OpenGL so I advise you to run your standard X server. You can launch the Xorg server by running startx.

  1. Then you need to set your ssh connection in Jenkins without the -X parameter because we want the rendering to be done locally
  2. Then you need to declare the environement variable DISPLAY to the default X client's value. Most of the time it is :0

This value will ask to open all the windows you launch through the ssh connexion into the first X client. It is the one running on the computer screen. To check the DISPLAY value you need to enter, you need to access the computer physically and type echo $DISPLAY. Most of the time this value is :0

Also, if your computer is not compatible with the hardware requirements, you can use another computer on your network to run your tests thanks to the Jenkins nodes. Here is a good tutorial to set it up.

And finally, I want to mention we will soon release a command line tool for Genymotion and a Gradle Plugin that will allows you to control your Genymotion devices running during your tests directly from your build.gradle file.

eyal-lezmy
  • 6,960
  • 3
  • 38
  • 35
  • I will give it a try for 'startX'. However, I don't think X server is a problem here because I can see the GenyMotion starts up and then died because of DHCP problem, device cannot get IP address. – SPK Apr 02 '15 at 01:55
  • Also, I have verified my DHCP's server IP setting or even deleting 'vboxnet0'. (REF: http://stackoverflow.com/questions/18641423/not-able-to-start-genymotion-device) None of these solutions solves my problem. I even re-installed both VirtualBox and Genymotion and managed to launch it for the first time. After that, it always show the same error, cannot obtain IP address. Please advise. – SPK Apr 02 '15 at 02:03
0

It`s a bit late, but maybe this could help you out

### Get IP address of selected VM
VM_IP=`VBoxManage guestproperty get $VM_SELECTED androvm_ip_management | awk -     F ": " '{print $2}'`

I found this here (repo) respectively here (slides)

Dogosh
  • 141
  • 9