When creating an android emulator in jenkins I get the following in the console:
Consola Jenkins Emulator Mobile
$ C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\tools\android-sdk/platform-tools/adb.exe start-server
[android] Starting Android emulator
$ C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\tools\android-sdk/emulator/emulator.exe -skin 480x800 -ports 5684,5685 -report-console tcp:5837,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_320_WVGA_android-29_x86 -wipe-data
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\tools\android-sdk]!
emulator: Android emulator version 30.4.5.0 (build_id 7140946) (CL:N/A)
[android] Emulator did not appear to start; giving up
[android] Stopping Android emulator
$ C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\tools\android-sdk/platform-tools/adb.exe kill-server
Finished: NOT_BUILT```
Related
i am trying to run emulator on jenkins but whenever i run following command
emulator/emulator -skin 1080x1920 -ports 5784,5785 -report-console tcp:5868,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd emulatorname -wipe-data -no-window
i am getting following error
ERROR | could not connect to server on TCP:5868: Operation timed out
saving arm snapshot.... !!!
INFO | Wait for emulator (pid 99639) 20 seconds to shutdown gracefully before kill;you can set environment variable ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL(in seconds) to change the default value (20 seconds)
Can someone help with script which will open the emulator and wait till its finish boot
Jenkins can't start the emulator. Here is the console output of jenkins:
First time build. Skipping changelog.
Starting xvnc
[MatchMaking] $ vncserver :65 -localhost -nolisten tcp
New 'veam:65 (jenkins)' desktop is veam:65
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/veam:65.log
$ /usr/local/android-sdk/tools/android list target
[android] Using Android SDK: /usr/local/android-sdk
[android] Adding 256M SD card to AVD 'hudson_en-US_160_WXGA720_android-15_x86'...
$ /usr/local/android-sdk/platform-tools/adb start-server
$ /usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
SDL init failure, reason is: No available video device
* daemon not running. starting it now on port 39546 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /usr/local/android-sdk/platform-tools/adb disconnect localhost:34583
[android] Stopping Android emulator
$ /usr/local/android-sdk/platform-tools/adb kill-server
Terminating xvnc.
$ vncserver -kill :65
Killing Xvnc4 process ID 16861
Finished: NOT_BUILT
If I type in
/usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
or
/usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
I get
PANIC: Could not open: hudson_en-US_160_WXGA720_android-15_x86
I run jenkins on ubuntu 12.04.
The error "SDL init failure, reason is: No available video device" would suggest that the emulator isn't running in a graphical environment.
However, your log shows that a VNC server is being started. But perhaps the VNC server hasn't quite finished starting by the time the emulator starts.
You can check whether this is the case by delaying the emulator start by a few seconds.
From the Android Emulator plugin documentation:
Although the Android Emulator plugin has been designed to ensure it always runs after an Xvnc server has been started, the Xvnc plugin does not wait for the Xvnc server to be fully up-and-running before handing control over to the Android Emulator plugin.
For this reason, you may want to delay emulator startup by a few seconds (e.g. three to five), giving the Xvnc server time to finish starting-up before attempting to launch an Android emulator into it. To do so, enter the desired number of seconds in the "Startup delay" field under "Advanced" options.
Alternatively, you can untick the "Show emulator window" option in your job configuration, which won't show the emulator, and will remove the need to run a VNC server.
Jenkins can't start the emulator. Here is the console output of jenkins:
First time build. Skipping changelog.
Starting xvnc
[MatchMaking] $ vncserver :65 -localhost -nolisten tcp
New 'veam:65 (jenkins)' desktop is veam:65
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/veam:65.log
$ /usr/local/android-sdk/tools/android list target
[android] Using Android SDK: /usr/local/android-sdk
[android] Adding 256M SD card to AVD 'hudson_en-US_160_WXGA720_android-15_x86'...
$ /usr/local/android-sdk/platform-tools/adb start-server
$ /usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
SDL init failure, reason is: No available video device
* daemon not running. starting it now on port 39546 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /usr/local/android-sdk/platform-tools/adb disconnect localhost:34583
[android] Stopping Android emulator
$ /usr/local/android-sdk/platform-tools/adb kill-server
Terminating xvnc.
$ vncserver -kill :65
Killing Xvnc4 process ID 16861
Finished: NOT_BUILT
If I type in
/usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
or
/usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
I get
PANIC: Could not open: hudson_en-US_160_WXGA720_android-15_x86
I run jenkins on ubuntu 12.04.
The error "SDL init failure, reason is: No available video device" would suggest that the emulator isn't running in a graphical environment.
However, your log shows that a VNC server is being started. But perhaps the VNC server hasn't quite finished starting by the time the emulator starts.
You can check whether this is the case by delaying the emulator start by a few seconds.
From the Android Emulator plugin documentation:
Although the Android Emulator plugin has been designed to ensure it always runs after an Xvnc server has been started, the Xvnc plugin does not wait for the Xvnc server to be fully up-and-running before handing control over to the Android Emulator plugin.
For this reason, you may want to delay emulator startup by a few seconds (e.g. three to five), giving the Xvnc server time to finish starting-up before attempting to launch an Android emulator into it. To do so, enter the desired number of seconds in the "Startup delay" field under "Advanced" options.
Alternatively, you can untick the "Show emulator window" option in your job configuration, which won't show the emulator, and will remove the need to run a VNC server.
I set up a Jenkins Job on Cloudbees and I can successfully checkout and compile my Android project there. Now I would like to run some JUnit tests in the android emulator and added the Android emulator plugin. I set the “Show Emulator Window“ option to false but after startup of the emulator I always get the error message: “Emulator did not appear to start; giving up”.
Has anyone experience with Android builds on Cloudbees?
Build log:
$ /opt/android/android-sdk-linux/tools/android list target
[android] Using Android SDK: /opt/android/android-sdk-linux
[android] Creating Android AVD: /home/jenkins/.android/avd/hudson_en-US_160_WVGA_android-17_armeabi-v7a.avd
[android] /opt/android/android-sdk-linux/tools/android create avd -f -a -c 64M -s WVGA800 -n hudson_en-US_160_WVGA_android-17_armeabi-v7a -t android-17 --abi armeabi-v7a
$ /opt/android/android-sdk-linux/platform-tools/adb start-server
[android] Starting Android emulator
$ /opt/android/android-sdk-linux/tools/emulator -no-boot-anim -ports 59102,56142 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-17_armeabi-v7a -no-snapshot-load -no-snapshot-save -no-window
Failed to Initialize backend EGL display
* daemon not running. starting it now on port 52538 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /opt/android/android-sdk-linux/platform-tools/adb disconnect localhost:56142
[android] Stopping Android emulator
$ /opt/android/android-sdk-linux/platform-tools/adb kill-server
Compare your job configuration with https://partnerdemo.ci.cloudbees.com/job/Android-dev/job/stockfish-android-cloud/, paying particular attention to the following settings:
Inject env var: LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib
Target ABI: armeabi-v7a
Advanced -> Emulator Options: -no-audio -gpu off
Advanced -> Emulator Executable: emulator64-arm
Jenkins can't start the emulator. Here is the console output of jenkins:
First time build. Skipping changelog.
Starting xvnc
[MatchMaking] $ vncserver :65 -localhost -nolisten tcp
New 'veam:65 (jenkins)' desktop is veam:65
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/veam:65.log
$ /usr/local/android-sdk/tools/android list target
[android] Using Android SDK: /usr/local/android-sdk
[android] Adding 256M SD card to AVD 'hudson_en-US_160_WXGA720_android-15_x86'...
$ /usr/local/android-sdk/platform-tools/adb start-server
$ /usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
SDL init failure, reason is: No available video device
* daemon not running. starting it now on port 39546 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /usr/local/android-sdk/platform-tools/adb disconnect localhost:34583
[android] Stopping Android emulator
$ /usr/local/android-sdk/platform-tools/adb kill-server
Terminating xvnc.
$ vncserver -kill :65
Killing Xvnc4 process ID 16861
Finished: NOT_BUILT
If I type in
/usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
or
/usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
I get
PANIC: Could not open: hudson_en-US_160_WXGA720_android-15_x86
I run jenkins on ubuntu 12.04.
The error "SDL init failure, reason is: No available video device" would suggest that the emulator isn't running in a graphical environment.
However, your log shows that a VNC server is being started. But perhaps the VNC server hasn't quite finished starting by the time the emulator starts.
You can check whether this is the case by delaying the emulator start by a few seconds.
From the Android Emulator plugin documentation:
Although the Android Emulator plugin has been designed to ensure it always runs after an Xvnc server has been started, the Xvnc plugin does not wait for the Xvnc server to be fully up-and-running before handing control over to the Android Emulator plugin.
For this reason, you may want to delay emulator startup by a few seconds (e.g. three to five), giving the Xvnc server time to finish starting-up before attempting to launch an Android emulator into it. To do so, enter the desired number of seconds in the "Startup delay" field under "Advanced" options.
Alternatively, you can untick the "Show emulator window" option in your job configuration, which won't show the emulator, and will remove the need to run a VNC server.