Skip to content

utils: Boot and tear-down Android Emulator in build.ps1 #80022

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weliveindetail
Copy link
Member

Successful runs should look like this:

ANDROID_SDK_HOME = S:\h\android-sdk
S:\h\android-sdk\cmdline-tools\latest\bin\avdmanager.bat list avd reports:
Available Android Virtual Devices:
    Name: swift-test-device-x86_64
    Path: S:\h\android-sdk\.android\avd\swift-test-device-x86_64.avd
  Target: Default Android System Image
          Based on: Android 10.0 ("Q") Tag/ABI: default/x86_64
  Sdcard: 512 MB
Found Android virtual device for arch x86_64
S:\h\android-sdk\cmdline-tools\latest\bin\avdmanager.bat list avd reports:
Available Android Virtual Devices:
    Name: swift-test-device-x86_64
    Path: S:\h\android-sdk\.android\avd\swift-test-device-x86_64.avd
  Target: Default Android System Image
          Based on: Android 10.0 ("Q") Tag/ABI: default/x86_64
  Sdcard: 512 MB
S:\h\android-sdk\emulator\emulator.exe -list-avds reports:
swift-test-device-x86_64
Start Android emulator for arch x86_64
Waiting for process 45100 to start
Waiting while Android emulator boots in process 45100
adb wait-for-device running in process 44512
* daemon not running; starting now at tcp:5037
* daemon started successfully
SUCCESS: Emulator ready
Tear down Android emulator for arch x86_64
Waiting for process 45100 to exit

Failed runs like this:

Start Android emulator for arch x86_64
Waiting for process 28344 to start
Process 28344 failed to start, trying again...
Waiting for process 3996 to start
Process 3996 failed to start, trying again...
Waiting for process 32500 to start
Process 32500 failed to start, trying again...
Waiting for process 20284 to start
Process 20284 failed to start, trying again...
Waiting for process 26468 to start
Error: Android emulator process 26468 failed to start.
    at <ScriptBlock>, S:\SourceCache\swift\utils\build.ps1: line 1056
    at Isolate-EnvVars, S:\SourceCache\swift\utils\build.ps1: line 645
    at AndroidEmulator-Run, S:\SourceCache\swift\utils\build.ps1: line 1019
    at <ScriptBlock>, S:\SourceCache\swift\utils\build.ps1: line 3305
  From System.Management.Automation.RuntimeException: Android emulator process 26468 failed to start.

******** emulator-stdout.log ********
INFO         | Android emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found AVD name 'xxswift-test-device-x86_64'
INFO         | path_getRootIniPath(xxswift-test-device-x86_64) returned NULL
ERROR        | Unknown AVD name [xxswift-test-device-x86_64], use -list-avds to see valid list.
ERROR        | ANDROID_SDK_HOME is defined but there is no file xxswift-test-device-x86_64.ini in $ANDROID_SDK_HOME\avd
ERROR        | (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd)

******** emulator-stderr.log ********

Successful runs should look like this:
```
ANDROID_SDK_HOME = S:\h\android-sdk
S:\h\android-sdk\cmdline-tools\latest\bin\avdmanager.bat list avd reports:
Available Android Virtual Devices:
    Name: swift-test-device-x86_64
    Path: S:\h\android-sdk\.android\avd\swift-test-device-x86_64.avd
  Target: Default Android System Image
          Based on: Android 10.0 ("Q") Tag/ABI: default/x86_64
  Sdcard: 512 MB
Found Android virtual device for arch x86_64
S:\h\android-sdk\cmdline-tools\latest\bin\avdmanager.bat list avd reports:
Available Android Virtual Devices:
    Name: swift-test-device-x86_64
    Path: S:\h\android-sdk\.android\avd\swift-test-device-x86_64.avd
  Target: Default Android System Image
          Based on: Android 10.0 ("Q") Tag/ABI: default/x86_64
  Sdcard: 512 MB
S:\h\android-sdk\emulator\emulator.exe -list-avds reports:
swift-test-device-x86_64
Start Android emulator for arch x86_64
Waiting for process 45100 to start
Waiting while Android emulator boots in process 45100
adb wait-for-device running in process 44512
* daemon not running; starting now at tcp:5037
* daemon started successfully
SUCCESS: Emulator ready
Tear down Android emulator for arch x86_64
Waiting for process 45100 to exit
```

Failed runs like this:
```
Start Android emulator for arch x86_64
Waiting for process 28344 to start
Process 28344 failed to start, trying again...
Waiting for process 3996 to start
Process 3996 failed to start, trying again...
Waiting for process 32500 to start
Process 32500 failed to start, trying again...
Waiting for process 20284 to start
Process 20284 failed to start, trying again...
Waiting for process 26468 to start
Error: Android emulator process 26468 failed to start.
    at <ScriptBlock>, S:\SourceCache\swift\utils\build.ps1: line 1056
    at Isolate-EnvVars, S:\SourceCache\swift\utils\build.ps1: line 645
    at AndroidEmulator-Run, S:\SourceCache\swift\utils\build.ps1: line 1019
    at <ScriptBlock>, S:\SourceCache\swift\utils\build.ps1: line 3305
  From System.Management.Automation.RuntimeException: Android emulator process 26468 failed to start.

******** emulator-stdout.log ********
INFO         | Android emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found AVD name 'xxswift-test-device-x86_64'
INFO         | path_getRootIniPath(xxswift-test-device-x86_64) returned NULL
ERROR        | Unknown AVD name [xxswift-test-device-x86_64], use -list-avds to see valid list.
ERROR        | ANDROID_SDK_HOME is defined but there is no file xxswift-test-device-x86_64.ini in $ANDROID_SDK_HOME\avd
ERROR        | (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd)

******** emulator-stderr.log ********
```
@weliveindetail
Copy link
Member Author

@swift-ci please test Windows

@weliveindetail
Copy link
Member Author

This is the common base from previous attempts in #79081 and #78762, which failed due to missing hardware acceleration support.

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

Successfully merging this pull request may close these issues.

1 participant