• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • OSX: 10.10, Jenkins ver. 1.598, Android Emulator Plugin 2.12, Android Platform Tools 21

      [android] Using Android SDK: /Users/dev/android-sdk-macosx
      $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server

      • daemon not running. starting it now on port 5585 *
      • daemon started successfully *
        $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server
        $ /Users/dev/android-sdk-macosx/tools/emulator-arm -snapshot-list -no-window -avd ARM_Emulator
        FATAL: Cannot run program "/Users/dev/android-sdk-macosx/tools/emulator-arm": error=2, No such file or directory
        java.io.IOException: Cannot run program "/Users/dev/android-sdk-macosx/tools/emulator-arm": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
        at hudson.Launcher$ProcStarter.start(Launcher.java:381)
        at hudson.Launcher$ProcStarter.join(Launcher.java:388)
        at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:425)
        at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:403)
        at hudson.plugins.android_emulator.EmulatorConfig.hasExistingSnapshot(EmulatorConfig.java:357)
        at hudson.plugins.android_emulator.AndroidEmulator.doSetUp(AndroidEmulator.java:312)
        at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:263)
        at hudson.model.Build$BuildExecution.doRun(Build.java:154)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
        at hudson.model.Run.execute(Run.java:1718)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:89)
        at hudson.model.Executor.run(Executor.java:240)
        Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:184)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 16 more

          [JENKINS-26893] Unable to run emulator-arm to start emulator

          Do you have the SDK tools installed? i.e. at the path mentioned — /Users/dev/android-sdk-macosx/tools?
          If so, does the user that's running Jenkins have permission to access that directory and execute the commands in that directory?

          Did you really mean OS X 10.2.2, as I'm pretty sure the SDK (or parts of it) stopped working a long time ago on anything older than 10.6 (or so)?

          Christopher Orr added a comment - Do you have the SDK tools installed? i.e. at the path mentioned — /Users/dev/android-sdk-macosx/tools ? If so, does the user that's running Jenkins have permission to access that directory and execute the commands in that directory? Did you really mean OS X 10.2.2, as I'm pretty sure the SDK (or parts of it) stopped working a long time ago on anything older than 10.6 (or so)?

          Also, since you explicitly mention emulator-arm, does that mean that the other emulator binaries do work?
          If so, does emulator-arm work if you run it manually on the command line?

          Christopher Orr added a comment - Also, since you explicitly mention emulator-arm , does that mean that the other emulator binaries do work? If so, does emulator-arm work if you run it manually on the command line?

          Wesley Archbell added a comment - - edited

          sorry yes its for OS X 10.10, not permissions issue. emulator-arm executable does not exist (only emulator64-arm)

          Wesleys-MacBook-Pro:tools wesley$ ls -la /Users/wesley/apps/android/sdk/tools
          total 19416
          drwxr-xr-x 26 wesley staff 884 31 Dec 13:05 .
          drwxrwxr-x@ 14 wesley staff 476 31 Dec 13:05 ..
          rw-rr- 1 wesley staff 763411 31 Dec 13:05 NOTICE.txt
          -rwxr-xr-x 1 wesley staff 3498 31 Dec 13:05 android
          drwxr-xr-x 5 wesley staff 170 31 Dec 13:05 ant
          drwxr-xr-x 3 wesley staff 102 31 Dec 13:05 apps
          -rwxr-xr-x 1 wesley staff 3286 31 Dec 13:05 ddms
          -rwxr-xr-x 1 wesley staff 1940 31 Dec 13:05 draw9patch
          -rwxr-xr-x 1 wesley staff 46444 31 Dec 13:05 emulator
          -rwxr-xr-x 1 wesley staff 3015608 31 Dec 13:05 emulator64-arm
          -rwxr-xr-x 1 wesley staff 2906988 31 Dec 13:05 emulator64-mips
          -rwxr-xr-x 1 wesley staff 3113608 31 Dec 13:05 emulator64-x86
          -rwxr-xr-x 1 wesley staff 3464 31 Dec 13:05 hierarchyviewer
          -rwxr-xr-x 1 wesley staff 1845 31 Dec 13:05 jobb
          drwxr-xr-x 82 wesley staff 2788 31 Dec 13:05 lib
          -rwxr-xr-x 1 wesley staff 2046 31 Dec 13:05 lint
          -rwxr-xr-x 1 wesley staff 13892 31 Dec 13:05 mksdcard
          -rwxr-xr-x 1 wesley staff 1293 31 Dec 13:05 monitor
          -rwxr-xr-x 1 wesley staff 3176 31 Dec 13:05 monkeyrunner
          drwxr-xr-x 12 wesley staff 408 31 Dec 13:05 proguard
          -rwxr-xr-x 1 wesley staff 2259 31 Dec 13:05 screenshot2
          rw-rr- 1 wesley staff 16545 31 Dec 13:05 source.properties
          drwxr-xr-x 11 wesley staff 374 31 Dec 13:05 support
          drwxr-xr-x 6 wesley staff 204 31 Dec 13:05 templates
          -rwxr-xr-x 1 wesley staff 3219 31 Dec 13:05 traceview
          -rwxr-xr-x 1 wesley staff 3054 31 Dec 13:05 uiautomatorviewer

          Wesley Archbell added a comment - - edited sorry yes its for OS X 10.10, not permissions issue. emulator-arm executable does not exist (only emulator64-arm) Wesleys-MacBook-Pro:tools wesley$ ls -la /Users/wesley/apps/android/sdk/tools total 19416 drwxr-xr-x 26 wesley staff 884 31 Dec 13:05 . drwxrwxr-x@ 14 wesley staff 476 31 Dec 13:05 .. rw-r r - 1 wesley staff 763411 31 Dec 13:05 NOTICE.txt -rwxr-xr-x 1 wesley staff 3498 31 Dec 13:05 android drwxr-xr-x 5 wesley staff 170 31 Dec 13:05 ant drwxr-xr-x 3 wesley staff 102 31 Dec 13:05 apps -rwxr-xr-x 1 wesley staff 3286 31 Dec 13:05 ddms -rwxr-xr-x 1 wesley staff 1940 31 Dec 13:05 draw9patch -rwxr-xr-x 1 wesley staff 46444 31 Dec 13:05 emulator -rwxr-xr-x 1 wesley staff 3015608 31 Dec 13:05 emulator64-arm -rwxr-xr-x 1 wesley staff 2906988 31 Dec 13:05 emulator64-mips -rwxr-xr-x 1 wesley staff 3113608 31 Dec 13:05 emulator64-x86 -rwxr-xr-x 1 wesley staff 3464 31 Dec 13:05 hierarchyviewer -rwxr-xr-x 1 wesley staff 1845 31 Dec 13:05 jobb drwxr-xr-x 82 wesley staff 2788 31 Dec 13:05 lib -rwxr-xr-x 1 wesley staff 2046 31 Dec 13:05 lint -rwxr-xr-x 1 wesley staff 13892 31 Dec 13:05 mksdcard -rwxr-xr-x 1 wesley staff 1293 31 Dec 13:05 monitor -rwxr-xr-x 1 wesley staff 3176 31 Dec 13:05 monkeyrunner drwxr-xr-x 12 wesley staff 408 31 Dec 13:05 proguard -rwxr-xr-x 1 wesley staff 2259 31 Dec 13:05 screenshot2 rw-r r - 1 wesley staff 16545 31 Dec 13:05 source.properties drwxr-xr-x 11 wesley staff 374 31 Dec 13:05 support drwxr-xr-x 6 wesley staff 204 31 Dec 13:05 templates -rwxr-xr-x 1 wesley staff 3219 31 Dec 13:05 traceview -rwxr-xr-x 1 wesley staff 3054 31 Dec 13:05 uiautomatorviewer

          Thanks for the info.

          So it seems that Google quietly stopped bundling the 32-bit versions of the emulator for OS X as of SDK tools version 23.0.4.

          We required a 32-bit version of the emulator — when using snapshots — as a workaround for Android bug 34233, but that was fixed in SDK tools 22.6, so the plugin now no longer uses the 32-bit emulator executable.

          Christopher Orr added a comment - Thanks for the info. So it seems that Google quietly stopped bundling the 32-bit versions of the emulator for OS X as of SDK tools version 23.0.4. We required a 32-bit version of the emulator — when using snapshots — as a workaround for Android bug 34233, but that was fixed in SDK tools 22.6, so the plugin now no longer uses the 32-bit emulator executable.

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          src/main/java/hudson/plugins/android_emulator/SdkInstaller.java
          src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java
          src/main/java/hudson/plugins/android_emulator/util/Utils.java
          src/test/java/hudson/plugins/android_emulator/sdk/AndroidSdkTest.java
          src/test/java/hudson/plugins/android_emulator/util/UtilsTest.java
          http://jenkins-ci.org/commit/android-emulator-plugin/b02c1cf8f0cc6b6fbc3686bcd0d3334a414a13c0
          Log:
          [FIXED JENKINS-26893] Disable the Android bug #34233 workaround on newer SDKs.

          We no longer need to avoid the 64-bit emulators as of SDK tools version 22.6,
          and the 32-bit emulators are no longer bundled on OS X, so hardcoding the usage
          of `emulator-arm` was no longer working.

          Now we only apply the workaround if an affected SDK tools version is installed.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java src/main/java/hudson/plugins/android_emulator/SdkInstaller.java src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java src/main/java/hudson/plugins/android_emulator/util/Utils.java src/test/java/hudson/plugins/android_emulator/sdk/AndroidSdkTest.java src/test/java/hudson/plugins/android_emulator/util/UtilsTest.java http://jenkins-ci.org/commit/android-emulator-plugin/b02c1cf8f0cc6b6fbc3686bcd0d3334a414a13c0 Log: [FIXED JENKINS-26893] Disable the Android bug #34233 workaround on newer SDKs. We no longer need to avoid the 64-bit emulators as of SDK tools version 22.6, and the 32-bit emulators are no longer bundled on OS X, so hardcoding the usage of `emulator-arm` was no longer working. Now we only apply the workaround if an affected SDK tools version is installed.

          Thanks thats great. Do you know which version it will be fixed in and when will it be released?

          Wesley Archbell added a comment - Thanks thats great. Do you know which version it will be fixed in and when will it be released?

          It will be fixed in the next release, which I'm hoping to do within a week — I have some larger changes that need to be tested first.

          In the meantime, you can try installing the latest build, which has this fix included. You can find the .hpi file which you can upload via the Jenkins web UI here:
          https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/lastSuccessfulBuild/org.jenkins-ci.plugins$android-emulator/

          Alternatively, you can make a symlink in your Android SDK directory so that emulator-arm appears to exist:
          cd /Users/wesley/apps/android/sdk/tools; ln -s emulator64-arm emulator-arm

          Christopher Orr added a comment - It will be fixed in the next release, which I'm hoping to do within a week — I have some larger changes that need to be tested first. In the meantime, you can try installing the latest build, which has this fix included. You can find the .hpi file which you can upload via the Jenkins web UI here: https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/lastSuccessfulBuild/org.jenkins-ci.plugins$android-emulator/ Alternatively, you can make a symlink in your Android SDK directory so that emulator-arm appears to exist: cd /Users/wesley/apps/android/sdk/tools; ln -s emulator64-arm emulator-arm

          Yep i was using the symlink in the past. Thanks

          Wesley Archbell added a comment - Yep i was using the symlink in the past. Thanks

          I know this is a separate issue but when will we be able to run this plugin against HAXM emulator?

          Wesley Archbell added a comment - I know this is a separate issue but when will we be able to run this plugin against HAXM emulator?

          That has always been possible (well, since shortly after HAXM appeared). Are you having problems starting an x86 emulator?

          Christopher Orr added a comment - That has always been possible (well, since shortly after HAXM appeared). Are you having problems starting an x86 emulator?

          I can see it start the emulator on mac mini but even once its started, the logs still indicate the device is offline even though emulator has started..

          $ /Users/dev/android-sdk-macosx/tools/android list target
          [android] Using Android SDK: /Users/dev/android-sdk-macosx
          $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server

          • daemon not running. starting it now on port 5799 *
          • daemon started successfully *
            $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server
            [android] Starting Android emulator
            [android] Erasing existing emulator data...
            $ /Users/dev/android-sdk-macosx/tools/emulator -no-boot-anim -ports 5797,5798 -avd HAXM_Emulator -no-snapshot-load -no-snapshot-save -wipe-data
            Creating filesystem with parameters:
            Size: 69206016
            Block size: 4096
            Blocks per group: 32768
            Inodes per group: 4224
            Inode size: 256
            Journal blocks: 1024
            Label:
            Blocks: 16896
            Block groups: 1
            Reserved block group size: 7
            Created filesystem with 11/4224 inodes and 1302/16896 blocks
            HAX is working and emulator runs in fast virt mode
            $ /Users/dev/android-sdk-macosx/platform-tools/adb connect emulator-5797
            [android] Waiting for emulator to finish booting...
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline
            $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete
            error: device offline

          Wesley Archbell added a comment - I can see it start the emulator on mac mini but even once its started, the logs still indicate the device is offline even though emulator has started.. $ /Users/dev/android-sdk-macosx/tools/android list target [android] Using Android SDK: /Users/dev/android-sdk-macosx $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server daemon not running. starting it now on port 5799 * daemon started successfully * $ /Users/dev/android-sdk-macosx/platform-tools/adb start-server [android] Starting Android emulator [android] Erasing existing emulator data... $ /Users/dev/android-sdk-macosx/tools/emulator -no-boot-anim -ports 5797,5798 -avd HAXM_Emulator -no-snapshot-load -no-snapshot-save -wipe-data Creating filesystem with parameters: Size: 69206016 Block size: 4096 Blocks per group: 32768 Inodes per group: 4224 Inode size: 256 Journal blocks: 1024 Label: Blocks: 16896 Block groups: 1 Reserved block group size: 7 Created filesystem with 11/4224 inodes and 1302/16896 blocks HAX is working and emulator runs in fast virt mode $ /Users/dev/android-sdk-macosx/platform-tools/adb connect emulator-5797 [android] Waiting for emulator to finish booting... $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline $ /Users/dev/android-sdk-macosx/platform-tools/adb -s emulator-5797 shell getprop dev.bootcomplete error: device offline

          See attachment for plugin configuration. I know the existing emulator works because if i start it manually via AVD it works fine and tests run successfully against it

          Wesley Archbell added a comment - See attachment for plugin configuration. I know the existing emulator works because if i start it manually via AVD it works fine and tests run successfully against it

          Also tried setting the 'Emulator executable' Advanced option to emulator-arm (which is a symlink to emulator64-arm) but it still called the 'emulator' executable instead of 'emulator-arm'

          Wesley Archbell added a comment - Also tried setting the 'Emulator executable' Advanced option to emulator-arm (which is a symlink to emulator64-arm) but it still called the 'emulator' executable instead of 'emulator-arm'

          That's JENKINS-11952, for which I'm going to publish a fix today and try and get people to test it out.

          Christopher Orr added a comment - That's JENKINS-11952 , for which I'm going to publish a fix today and try and get people to test it out.

          Version 2.13 of the plugin has been released, which includes this fix.

          Christopher Orr added a comment - Version 2.13 of the plugin has been released, which includes this fix.

            orrc Christopher Orr
            wesleyarchbell Wesley Archbell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: