Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23736

Emulator plugin can not run emulator if user is not logged on to desktop

      When running a build that uses the emulator plugin to start an emulator, this happens if the Jenkins's user isn't logged on to the desktop on the machine.

      [android] Using Android SDK: /Users/Shared/Jenkins/android/adt-bundle/sdk
      $ /Users/Shared/Jenkins/android/adt-bundle/sdk/platform-tools/adb start-server
      _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
      ERROR: Timeout after 5 seconds
      $ /Users/Shared/Jenkins/android/adt-bundle/sdk/platform-tools/adb start-server
      _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
      ERROR: Timeout after 5 seconds
      [android] Starting Android emulator
      $ /Users/Shared/Jenkins/android/adt-bundle/sdk/tools/emulator -no-boot-anim -ports 5680,5681 -avd Nexus-S-2 -no-snapshot-load -no-snapshot-save -no-window -noaudio
      _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
      2014-07-10 11:10:04.006 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.007 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.007 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.007 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.008 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      2014-07-10 11:10:04.009 emulator64-arm[5457:d0b] invalid CoreGraphics connection
      Failed to create Context 0x3005
      emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
      $ /Users/Shared/Jenkins/android/adt-bundle/sdk/platform-tools/adb connect emulator-5680
      _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

      Nothing more happens after this.

          [JENKINS-23736] Emulator plugin can not run emulator if user is not logged on to desktop

          Oskar Danielsson added a comment - - edited

          Added possibly related link JENKINS-23735

          Oskar Danielsson added a comment - - edited Added possibly related link JENKINS-23735

          I don't have a OS X system to test on but it looks like ADB is trying to connect to the graphical desktop but this is presumably failing because the Jenkins slave does not have access to the desktop.

          Richard Mortimer added a comment - I don't have a OS X system to test on but it looks like ADB is trying to connect to the graphical desktop but this is presumably failing because the Jenkins slave does not have access to the desktop.

          How do I solve this?

          Oskar Danielsson added a comment - How do I solve this?

          Searching for that error message seems to suggest that it's not possible without logging on to the desktop.

          For example:
          https://stackoverflow.com/questions/9157980/postbuild-uiautomation-script-not-running-in-jenkins
          https://stackoverflow.com/questions/13966595/build-unity-project-with-jenkins-failed

          We run OS X slaves and the emulator runs fine, but I think we run Jenkins in the way shown in those answers.

          Christopher Orr added a comment - Searching for that error message seems to suggest that it's not possible without logging on to the desktop. For example: https://stackoverflow.com/questions/9157980/postbuild-uiautomation-script-not-running-in-jenkins https://stackoverflow.com/questions/13966595/build-unity-project-with-jenkins-failed We run OS X slaves and the emulator runs fine, but I think we run Jenkins in the way shown in those answers.

          Vitaliy Popov added a comment -

          Vitaliy Popov added a comment - https://github.com/stisti/jenkins-app - it is help me!!!

          So it seems that this isn't a plugin issue.

          Christopher Orr added a comment - So it seems that this isn't a plugin issue.

            orrc Christopher Orr
            oskard Oskar Danielsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: