The following configuration of the android-maven-plugin will not find the running emulator on Jenkins.
      Commenting this line will find the emulator.
      On my local machine this is working fine, but not in Jenkins.
      Both machines use maven 3.0.4 on Linux/Ubuntu.

      <groupId>com.jayway.maven.plugins.android.generation2</groupId>
      <artifactId>android-maven-plugin</artifactId>
      <configuration>
      ...
      <device>emulator</device>
      ...
      </configuration>
      </plugin>

      This configuration is useful on the local machine, if you are developing while charging your phone via USB.
      Best regards, that's a really nice plugin!
      Sebl29

          [JENKINS-12821] android.device

          Proof of concept fix committed to my personal github a-e-p fork.
          https://github.com/oldelvet/android-emulator-plugin/tree/jenkins-12821-poc

          I intend to implement the port allocator side of this in due course but have verified that the fix allows android.device=emulator to work with the proof of concept.

          Richard Mortimer added a comment - Proof of concept fix committed to my personal github a-e-p fork. https://github.com/oldelvet/android-emulator-plugin/tree/jenkins-12821-poc I intend to implement the port allocator side of this in due course but have verified that the fix allows android.device=emulator to work with the proof of concept.

          Great stuff.

          Did you file that Android bug, out of interest?

          Christopher Orr added a comment - Great stuff. Did you file that Android bug, out of interest?

          No I didn't get around to filing it. With the new SDK being out I figure I ought to test against that before reporting it now.

          Richard Mortimer added a comment - No I didn't get around to filing it. With the new SDK being out I figure I ought to test against that before reporting it now.

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManager.java
          src/test/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManagerTest.java
          http://jenkins-ci.org/commit/port-allocator-plugin/007ca2616293ece2e033070e4e0ad13253eecd0a
          Log:
          Add PortAllocationManager#allocateConsecutivePortRange to allow multiple
          ports to be allocated together within a specific range of ports.
          This forms part of the fix for JENKINS-12821 in android-emulator-plugin..

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManager.java src/test/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManagerTest.java http://jenkins-ci.org/commit/port-allocator-plugin/007ca2616293ece2e033070e4e0ad13253eecd0a Log: Add PortAllocationManager#allocateConsecutivePortRange to allow multiple ports to be allocated together within a specific range of ports. This forms part of the fix for JENKINS-12821 in android-emulator-plugin..

          Edgar H added a comment - - edited

          When this bug should be fixed?
          Maybe it is possible to set a custom ports?
          It is pity, such a great plugin, and I cant use it with maven

          Edgar H added a comment - - edited When this bug should be fixed? Maybe it is possible to set a custom ports? It is pity, such a great plugin, and I cant use it with maven

          @Christopher Orr I finally managed to find time to log the issue in the AOSP issue tracker.

          http://code.google.com/p/android/issues/detail?id=60024

          Richard Mortimer added a comment - @Christopher Orr I finally managed to find time to log the issue in the AOSP issue tracker. http://code.google.com/p/android/issues/detail?id=60024

          For reference the fix to workaround the broken AOSP functionality is at
          https://github.com/jenkinsci/android-emulator-plugin/pull/27

          Richard Mortimer added a comment - For reference the fix to workaround the broken AOSP functionality is at https://github.com/jenkinsci/android-emulator-plugin/pull/27

          Version 2.11 of the plugin has been released including these fixes

          Christopher Orr added a comment - Version 2.11 of the plugin has been released including these fixes

          I just upgraded to 2.11(.1) specifically because I started having this issue recently and am now facing another weird one which seems related:

          After the plugin starts the emulator, its subsequent attempts to "connect" to it fail and ends up timing out. I see the emulator window available, but the sequence of "adb connect emulator-xxxx" and "adb -s emulator-xxxx shell getprop dev.bootcomplete" keeps on failing with a "error: device offline" error.

          any tips as to what could be the problem?

          Roberto Andrade added a comment - I just upgraded to 2.11(.1) specifically because I started having this issue recently and am now facing another weird one which seems related: After the plugin starts the emulator, its subsequent attempts to "connect" to it fail and ends up timing out. I see the emulator window available, but the sequence of "adb connect emulator-xxxx" and "adb -s emulator-xxxx shell getprop dev.bootcomplete" keeps on failing with a "error: device offline" error. any tips as to what could be the problem?

          I reopened https://issues.jenkins-ci.org/browse/JENKINS-11952 as it seems to be a better fit for the issue description, but I think it might have been caused by the changes that fixed this issue.

          Roberto Andrade added a comment - I reopened https://issues.jenkins-ci.org/browse/JENKINS-11952 as it seems to be a better fit for the issue description, but I think it might have been caused by the changes that fixed this issue.

            oldelvet Richard Mortimer
            sebl29 Sebastian Schefczyk
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: