Wait for Emulator Takes Forever

Hi I am getting the following error and my emulator never boot up. Following is my yml file, kindly help.

Build timed out after 5h0m0s

version: 2
jobs:
build:
working_directory: ~/MyTaxiAndroidDemo
docker:
- image: circleci/android:api-28

steps:
- checkout
- restore_cache:
    key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
    name: chmod permissions
    command: chmod +x ./gradlew
- run:
    name: Install licenses
    command: cp licenses/* /opt/android/sdk/licenses/
- run:
    name: Approve license for build tools
    command: (echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/tools/bin/sdkmanager --licenses && sdkmanager --update
- 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: Run Emulator
    background: true
    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 auto -verbose
- run:
    name: Wait for Emulator
    no_output_timeout: 15m
    command: |
        # wait for it to have booted
        circle-android wait-for-boot
        # unlock the emulator screen
        sleep 30
        adb shell input keyevent 82
- run:
    name: Run Android Connected Tests
    command: |
      export ADB_INSTALL_TIMEOUT=120
      export ANDROID_HOME=$ANDROID_SDK_ROOT
      # ./scripts/test.sh
      ./gradlew assembleDebug
      # Wait for emulator to fully boot
      # TODO: Need to create a good check
      sleep 60
      # Is the emulator still running?
      adb devices
      # Check if package manager is running
      adb shell pm list packages
      # Install package
      $ANDROID_SDK_ROOT/platform-tools/adb install /home/android/androidlearn/app/build/outputs/apk/app-debug.apk
      ./gradlew connectedAndroidTest


- run:
    name: Run Espresso UI Tests
    command: ./gradlew connectedDebugAndroidTest
- store_artifacts:
    path: app/build/reports
    destination: reports
- store_test_results:
    path: app/build/test-results

Done, Thank You for pointing out.

1 Like

OK. Which of your steps does it get stuck on? What is the stdout output when it gets stuck? You can copy that from the step, and place it here in another code block.

1 Like