SPK
SPK

Reputation: 38

Can Jenkins start up GenyMotion on Ubuntu 14, if I access the Jenkins website from my Mac?

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?

Upvotes: 0

Views: 565

Answers (2)

Dogosh
Dogosh

Reputation: 151

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)

Upvotes: 0

eyal-lezmy
eyal-lezmy

Reputation: 7116

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.

Upvotes: 0

Related Questions