Emulator not launching... forever

With this circle.yml file, the emulator is not launching…

checkout:
   post:
   - cp local.properties.ci local.properties
 dependencies:
   pre: 
    - git submodule update --init
# Pre-accept Android SDK components licenses
    - mkdir "$ANDROID_HOME/licenses" || true
    - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
    - if [ ! -d "/usr/local/android-sdk-linux/platforms/android-25" ]; then echo y | android update sdk --no-ui --all --filter "android-25,build-tools-25.0.3, extra-android-m2repository, extra-android-support,extra-google-google_play_services, extra-google-m2repository"; fi

machine:
   environment:
     ADB_INSTALL_TIMEOUT: 60
     JAVA_OPTS: "-Xms512m -Xmx1024m"
  java:
    version: oraclejdk8
  test:
    pre:
     - emulator -avd circleci-android25 -no-audio -no-window:
         background: true
         parallel: true
     - (./gradlew assemblePlaystoreDebug):
        timeout: 1200
     - (./gradlew assemblePlaystoreDebugAndroidTest):
        timeout: 1200
# copy the build outputs to artifacts
     - cp -r Fieldaware/build/outputs $CIRCLE_ARTIFACTS
override:
 - circle-android wait-for-boot
 - (echo "Running Espresso tests!")
 - adb install Fieldaware/build/outputs/*release.apk
 - adb install Fieldaware/build/outputs/*Test.apk
 - adb shell am instrument -w -r   -e debug false -e class com.fieldaware.app.test.espresso.EspressoUnitTestSuite com.fieldaware.app.test/android.support.test.runner.AndroidJUnitRunner

I don’t know if my testsuite will be run, because I’m stuck forever in :

  • circle-android wait-for-boot
1 Like

I’m using the versión 2.0 of this script and keep running forever when I try x86 emulator maybe you can try with this before launch emulator:

sdkmanager "system-images;android-25;google_apis;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;google_apis;armeabi-v7a

You can review my script here, I hope this can help you:

Thanks Rafael, I’ll try it.

1 Like

Hello. The same issue. I use - image: circleci/android:api-25-alpha and

  - run: android update sdk -u --filter platform-tools,android-25 --use-sdk-wrapper
  - run: sdkmanager --verbose "system-images;android-25;google_apis;armeabi-v7a"
  - run: echo no | avdmanager -v create avd -n arm -k "system-images;android-25;google_apis;armeabi-v7a" -g "google_apis"
  - run: emulator -avd arm -no-audio -no-window -gpu off &
  - run: circle-android wait-for-boot

emulator not launching :frowning:
I’m stuck in :

  • circle-android wait-for-boot

Try with this it’s work for me:

        - run:
            name: Setup emulator
            command: sdkmanager "system-images;android-16;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-16;default;armeabi-v7a"
        - run:
            name: Launch emulator
            command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
            background: true
        - run:
            name: Wait emulator
            command: |
              # wait for it to have booted
              circle-android wait-for-boot
              # unlock the emulator screen
              sleep 30
              adb shell input keyevent 82

The same…
I’m stuck in :

  • circle-android wait-for-boot
1 Like