Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start emulator in macos 13 and arm64 image in azure pipelines #9194

Closed
3 of 11 tasks
rkolipaka-98 opened this issue Jan 19, 2024 · 2 comments
Closed
3 of 11 tasks

Comments

@rkolipaka-98
Copy link

rkolipaka-98 commented Jan 19, 2024

Description

Hi, we have been trying to test our instrumentation tests on macos 13 arm64 machine but we are having hard time in starting the emulator.

It is taking forever to launch the emulator, my guess is that it is stuck at this.

$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'

Could someone please help us with this issue. Thank you :).

complete YML code

    - bash: |
        echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-33;google_apis;arm64-v8a'
      displayName: 'Download and install emulator image'
      # condition: ne(variables.AVD_IMAGES_RESTORED, 'true')
    - bash: |
        echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n android_emulator_pixel_6 -k 'system-images;android-33;google_apis;arm64-v8a' -d 17 --force --device "pixel_6"
        echo "Emulator created successfully"
        $ANDROID_HOME/emulator/emulator -list-avds
        if false; then
        emulator_config=~/.android/avd/android_emulator.avd/config.ini
        # The following madness is to support empty OR populated config.ini files,
        # the state of which is dependant on the version of the emulator used (which we don't control),
        # so let's be defensive to be safe.
        # Replace existing config (NOTE we're on MacOS so sed works differently!)
        sed -i .bak 's/hw.lcd.density=.*/hw.lcd.density=420/' "$emulator_config"
        sed -i .bak 's/hw.lcd.height=.*/hw.lcd.height=2400/' "$emulator_config"
        sed -i .bak 's/hw.lcd.width=.*/hw.lcd.width=1080/' "$emulator_config"
        # Or, add new config
        if ! grep -q "hw.lcd.density" "$emulator_config"; then
          echo "hw.lcd.density=420" >> "$emulator_config"
        fi
        if ! grep -q "hw.lcd.height" "$emulator_config"; then
          echo "hw.lcd.height=2400" >> "$emulator_config"
        fi
        if ! grep -q "hw.lcd.width" "$emulator_config"; then
          echo "hw.lcd.width=1080" >> "$emulator_config"
        fi
        echo "Emulator settings ($emulator_config)"
        cat "$emulator_config"
        fi
      displayName: 'Create emulator'
    - bash: |
        echo "Starting emulator and waiting for boot to complete...."
        nohup $ANDROID_HOME/emulator/emulator -avd android_emulator_pixel_6 -no-snapshot -netdelay none -netspeed full -no-audio -no-boot-anim -accel auto -gpu swiftshader_indirect -qemu > /dev/null 2>&1 &
        $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'
        echo "Emulator has finished booting"
        $ANDROID_HOME/platform-tools/adb devices
        $ANDROID_HOME/platform-tools/adb shell input keyevent 82
        $ANDROID_HOME/platform-tools/adb shell settings put system screen_off_timeout 86400000
        $ANDROID_HOME/platform-tools/adb shell settings put global window_animation_scale 0
        $ANDROID_HOME/platform-tools/adb shell settings put global transition_animation_scale 0
        $ANDROID_HOME/platform-tools/adb shell settings put global animator_duration_scale 0
        screencapture screenshot.jpg
        $ANDROID_HOME/platform-tools/adb exec-out screencap -p > emulator.jpg
      displayName: 'Start emulator'
    - task: CopyFiles@2
      inputs:
        contents: '**/*.jpg'
        targetFolder: '$(Build.ArtifactStagingDirectory)/droid_ss'
    - publish: '$(Build.ArtifactStagingDirectory)/droid_ss/'
      artifact: Droid_ss_artifact


Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Runner Image
Image: macos-13-arm64
Version: 20240114.1

Is it regression?

Not sure, we are trying it for the first time

Expected behavior

Emulator should successfully boot up.

Actual behavior

Emulator is not booting up.

Repro steps

I have provided the yml code that we are using to start the emulator.

@rkolipaka-98 rkolipaka-98 changed the title Unable to start emulator in macos 13 arm64 image in azure pipelines Unable to start emulator in macos 13 and arm64 image in azure pipelines Jan 19, 2024
@sergei-pyshnoi
Copy link
Contributor

Hello @rkolipaka-98 . Thanks for your report. We will take a look

@sergei-pyshnoi
Copy link
Contributor

sergei-pyshnoi commented Jan 19, 2024

@rkolipaka-98 We officially doesnt support macos-13-arm64` image for AzureDevops . List of supported images you can see here https://github.com/actions/runner-images?tab=readme-ov-file#available-images .

Also looks like Anka doesn`t support nested virtualization https://docs.veertu.com/anka/faqs/#nested-virtualization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants