I have set up Jenkins on my local machine and I want to launch emulator from Jenkins portal. Inside Configuration of the Jenkins project, I have enabled "Run an Android emulator during build" and when I build the project, the system image is successfully downloaded. But I am not able to launch the emulator. The emulator launch fails with the following logs.
QXcbConnection: Could not connect to display
emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.
[android] Emulator did not appear to start; giving up
[android] Stopping Android emulator
$ /home/anshul/Android/Sdk/platform-tools/adb kill-server
Finished: NOT_BUILT
From the logs, I think that the process running it does not have the permission to connect to the display. How can I launch the emulator through Jenkins.
FYI:
Ubuntu version : 14.04
Android System image downloaded - 5.1