I am trying to run an AVD without window and boot animation for instrumented test in a pipeline workflow with Bitbucket. I am using Docker image with Android SDK that uses Linux Ubuntu.
The setup works and managed to create AVD however there is an error when starting it as it ask for hardware acceleration.
Script
+ emulator -avd EMU -no-window -no-audio -no-boot-anim & ./gradlew connectedAndroidTest mergeAndroidReports --continue
Error
WARNING | Crash annotation is very large (17292), only 16384 bytes will be recorded, 908 bytes are lost.
INFO | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 378
INFO | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)
INFO | Found systemPath /opt/android-sdk-linux/system-images/android-34/google_apis_playstore/x86_64/
WARNING | Crash annotation is very large (17651), only 16384 bytes will be recorded, 1267 bytes are lost.
WARNING | File System is not ext4, disable QuickbootFileBacked feature
Downloading https://services.gradle.org/distributions/gradle-8.4-bin.zip
ERROR | x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: KVM requires a CPU that supports vmx or svm
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
INFO | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 378
INFO | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
INFO | Increasing RAM size to 2048MB
[1]: https://github.com/mindrunner/docker-android-sdk
Based from this SO answer, I could probably use ARM as last resort even if it's slow as it does not requires hardware acceleration so I use system-images;android-23;google_apis;armeabi-v7a
I change the script to wait for adb before running gradlew
+ emulator -avd EMU -memory 2048 -cache-size 1000 -partition-size 6144 -wipe-data -no-window -no-audio -no-boot-anim & adb wait-for-device
+ ./gradlew connectedAndroidTest mergeAndroidReports --continue
Emulator start
* daemon not running; starting now at tcp:5037
WARNING | Crash annotation is very large (17355), only 16384 bytes will be recorded, 971 bytes are lost.
INFO | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 380
INFO | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)
INFO | Found systemPath /opt/android-sdk-linux/system-images/android-23/google_apis/armeabi-v7a/
WARNING | Crash annotation is very large (17713), only 16384 bytes will be recorded, 1329 bytes are lost.
WARNING | File System is not ext4, disable QuickbootFileBacked feature
WARNING | encryption is off
WARNING | FeatureControl is requesting a non existing feature.
WARNING | Your GPU drivers may have a bug. Switching to software rendering.
WARNING: cannnot unmap ptr 0x7efff4664000 as it is in the protected range from 0x7efff4664000 to 0x7f0074864000
WARNING: cannnot unmap ptr 0x7f0074801000 as it is in the protected range from 0x7efff4664000 to 0x7f0074864000
WARNING | Using fallback path for the emulator registration directory.
WARNING | The emulator now requires a signed jwt token for gRPC access! Use the -grpc flag if you really want an open unprotected grpc port
WARNING | *** Basic token auth should only be used by android-studio ***
WARNING | Using fallback path for the emulator registration directory.
INFO | Storing crashdata in: /tmp/android-unknown/emu-crash-34.1.20.db, detection is enabled for process: 380
INFO | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
library_mode swangle_indirect gpu mode swangle_indirect
Initializing hardware OpenGLES emulation supportandroid_startOpenglesRenderer: gpu infoI0429 22:07:24.206154 380 HealthMonitor.cpp:279] HealthMonitor disabled.
I0429 22:07:24.220783 380 FrameBuffer.cpp:486] Graphics Adapter Vendor Google (Google Inc.)
I0429 22:07:24.220791 380 FrameBuffer.cpp:487] Graphics Adapter Android Emulator OpenGL ES Translator (Google SwiftShader)
I0429 22:07:24.220793 380 FrameBuffer.cpp:488] Graphics API Version OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)
I0429 22:07:24.220794 380 FrameBuffer.cpp:489] Graphics API Extensions GL_OES_EGL_sync GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_standard_derivatives GL_OES_texture_npot GL_OES_rgb8_rgba8 GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888
I0429 22:07:24.220795 380 FrameBuffer.cpp:490] Graphics Device Extensions N/A
OpenGL Vendor=[Google (Google Inc.)]OpenGL Renderer=[Android Emulator OpenGL ES Translator (Google SwiftShader)]OpenGL Version=[OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)]INFO | Using security allow list from: /opt/android-sdk-linux/emulator/lib/emulator_access.json
INFO | The active JSON Web Key Sets can be found here: /opt/android-sdk-linux/.android/avd/running/380/jwks/c028d3c2-fd10-428d-adea-ca35206b1f07/active.jwk
INFO | Scanning /opt/android-sdk-linux/.android/avd/running/380/jwks/c028d3c2-fd10-428d-adea-ca35206b1f07 for jwk keys.
INFO | Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token
INFO | Advertising in: /opt/android-sdk-linux/.android/avd/running/pid_380.ini
I0429 22:07:24.334844 430 FrameBuffer.cpp:3707] setDisplayConfigs w 320 h 640 dpiX 160 dpiY 160
I0429 22:07:24.334870 430 FrameBuffer.cpp:3720] setDisplayActiveConfig 0
INFO | Loading snapshot 'default_boot'...
WARNING | Failed to process .ini file /opt/android-sdk-linux/.android/emu-update-last-check.ini for reading.
WARNING | Device 'userdata' does not have the requested snapshot 'default_boot'
WARNING | Failed to load snapshot 'default_boot'
WARNING | Cold boot based on user configuration
INFO | Cold boot based on user configuration
WARNING | Failed to process .ini file /opt/android-sdk-linux/.android/emu-update-last-check.ini for reading.
* daemon started successfully
Instrumented test start but then I get an error in installation as it seems like the emulator is not responding.
Welcome to Gradle 8.4!
Here are the highlights of this release:
- Compiling and testing with Java 21
- Faster Java compilation on Windows
- Role focused dependency configurations creation
For more details see https://docs.gradle.org/8.4/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :app
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
> Configure project :app:libs:AndroidCommon
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
The Jacoco plugin extension version '0.8.9' is not currently available in the Android Gradle Plugin. Setting the version to 0.8.8
> Task :app:libs:AndroidCommon:preBuild UP-TO-DATE
> Task :app:libs:AndroidFirebase:preBuild UP-TO-DATE
... more tasks here
> Task :app:libs:AndroidCommon:connectedDebugAndroidTest
additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found
> Task :app:libs:AndroidMaterial:mergeDebugAndroidTestGlobalSynthetics
> Task :app:processDebugAndroidTestJavaRes
... more tasks here
> Task :app:libs:AndroidCommon:connectedDebugAndroidTest
Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: ErrorName: UNKNOWN
NameSpace: DdmlibAndroidDeviceController
ErrorCode: 1
ErrorType: TEST
Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]
Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]
Unknown platform error occurred when running the UTP test suite. Please check logs for details.
com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$20(DeviceImpl.java:892)
at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1802)
at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:756)
at com.android.ddmlib.SplitApkInstallerBase.installCommit(SplitApkInstallerBase.java:137)
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)
at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$36(DeviceImpl.java:1492)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1489)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$37(DeviceImpl.java:1504)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1500)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDevice.installPackages(DdmlibAndroidDevice.kt:74)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceController$executeAsync$deferred$1.invokeSuspend(DdmlibAndroidDeviceController.kt:254)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
> Task :app:libs:AndroidMaterial:mergeDebugAndroidTestJavaResource
> Task :app:libs:AndroidMaterial:checkDebugAndroidTestDuplicateClasses
... more tasks here
> Task :app:connectedDebugAndroidTest
> Task :app:libs:AndroidCommon:connectedDebugAndroidTest
Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: ErrorName: UNKNOWN
NameSpace: DdmlibAndroidDeviceController
ErrorCode: 1
ErrorType: TEST
Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]
Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/outputs/apk/androidTest/debug/AndroidCommon-debug-androidTest.apk]
Unknown platform error occurred when running the UTP test suite. Please check logs for details.
com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$20(DeviceImpl.java:892)
at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1802)
at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:756)
at com.android.ddmlib.SplitApkInstallerBase.installCommit(SplitApkInstallerBase.java:137)
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)
at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$36(DeviceImpl.java:1492)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1489)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$37(DeviceImpl.java:1504)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1500)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDevice.installPackages(DdmlibAndroidDevice.kt:74)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceController$executeAsync$deferred$1.invokeSuspend(DdmlibAndroidDeviceController.kt:254)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/app/libs/AndroidCommon/build/reports/androidTests/connected/debug/index.html
> Task :app:libs:AndroidCommon:connectedAndroidTest
> Task :app:connectedDebugAndroidTest
additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found
Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: ErrorName: Test APK installation Error
NameSpace: AndroidTestApkInstallerPlugin
ErrorCode: 2002
ErrorType: TEST
Message: Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.
Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.
com.google.testing.platform.core.error.UtpException: ErrorName: Test APK installation Error
NameSpace: AndroidTestApkInstallerPlugin
ErrorCode: 2002
ErrorType: TEST
Message: Failed to install APK: [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk] on device emulator-5554.
at com.android.tools.utp.plugins.host.apkinstaller.AndroidTestApkInstallerPlugin.beforeAll(AndroidTestApkInstallerPlugin.kt:236)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1$1.invoke(PluginLifecycle.kt:206)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1$1.invoke(PluginLifecycle.kt:206)
at com.google.testing.platform.plugin.PluginLifecycle$verify$1.invoke(PluginLifecycle.kt:131)
at com.google.testing.platform.api.event.Events$DefaultImpls.verify(Events.kt:38)
at com.google.testing.platform.core.event.MutableEvents$DefaultImpls.verify(MutableEvents.kt:7)
at com.google.testing.platform.core.event.PhaseGlobalEvents.verify(PhaseGlobalEvents.kt:20)
at com.google.testing.platform.plugin.PluginLifecycle.verify(PluginLifecycle.kt:131)
at com.google.testing.platform.plugin.PluginLifecycle.verify$default(PluginLifecycle.kt:127)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1.invoke(PluginLifecycle.kt:206)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1$2$1.invoke(PluginLifecycle.kt:205)
at com.google.testing.platform.plugin.PluginLifecycleKt$invokeOrThrow$1$1.invoke(PluginLifecycle.kt:538)
at com.google.testing.platform.plugin.PluginLifecycleKt$invokeOrThrow$1$1.invoke(PluginLifecycle.kt:538)
at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)
at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)
at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)
at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)
at com.google.testing.platform.plugin.PluginLifecycleKt.invokeOrThrow(PluginLifecycle.kt:533)
at com.google.testing.platform.plugin.PluginLifecycleKt.invokeOrThrow$default(PluginLifecycle.kt:517)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1.invoke(PluginLifecycle.kt:205)
at com.google.testing.platform.plugin.PluginLifecycle$onBeforeAll$1$1.invoke(PluginLifecycle.kt:199)
at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)
at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)
at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)
at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)
at com.google.testing.platform.plugin.PluginLifecycle.onBeforeAll(PluginLifecycle.kt:197)
at com.google.testing.platform.executor.SingleDeviceExecutor$execute$5.invoke(SingleDeviceExecutor.kt:136)
at com.google.testing.platform.executor.SingleDeviceExecutor$execute$5.invoke(SingleDeviceExecutor.kt:136)
at com.google.testing.platform.lib.cancellation.ProcessCancellationContext.runUnlessCancelled(ProcessCancellationContext.kt:136)
at com.google.testing.platform.executor.SingleDeviceExecutor.execute(SingleDeviceExecutor.kt:136)
at com.google.testing.platform.RunnerImpl.run(RunnerImpl.kt:121)
at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4$2.invoke(NonInteractiveServerStrategy.kt:98)
at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4$2.invoke(NonInteractiveServerStrategy.kt:98)
at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)
at com.google.testing.platform.core.telemetry.SequentialEventRecordRequest.record$java_com_google_testing_platform_core_telemetry_telemetry_api(EventRecordRequest.kt:71)
at com.google.testing.platform.core.telemetry.DiagnosticsExtKt.record(DiagnosticsExt.kt:27)
at com.google.testing.platform.core.telemetry.TelemetryKt.createEvent(Telemetry.kt:60)
at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy.run(NonInteractiveServerStrategy.kt:95)
at com.google.testing.platform.main.MainKt$main$4.invokeSuspend(Main.kt:75)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.google.testing.platform.main.MainKt.main(Main.kt:73)
at com.google.testing.platform.main.MainKt.main$default(Main.kt:35)
at com.google.testing.platform.main.MainKt.main(Main.kt)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.google.testing.platform.launcher.Launcher.main(Launcher.java:154)
There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/app/build/reports/androidTests/connected/debug/index.html
> Task :app:connectedAndroidTest
> Task :mergeAndroidReports
BUILD SUCCESSFUL in 23m 47s
324 actionable tasks: 324 executed
When the last script for killing emulator was executed, it was successful.
adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done
saving arm snapshot.... !!!
OK: killing emulator, bye bye
OK
INFO | Wait for emulator (pid 380) 20 seconds to shutdown gracefully before kill;you can set environment variable ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL(in seconds) to change the default value (20 seconds)
Tried it again with adb devices -l
and it shows connected devices
emulator-5554 device product:sdk_google_phone_armv7 model:sdk_google_phone_armv7 device:generic transport_id:1
Then gets a different error at running instrumented test in app module
> Task :app:connectedDebugAndroidTest
additionalTestOutput is not supported on this device running API level 23 because the additional test output directory could not be found
Exception thrown during onBeforeAll invocation of plugin AndroidTestApkInstallerPlugin: ErrorName: UNKNOWN
NameSpace: DdmlibAndroidDeviceController
ErrorCode: 1
ErrorType: TEST
Message: Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk]
Failed to install split APK(s): [/opt/atlassian/pipelines/agent/build/app/build/outputs/apk/debug/app-debug.apk]
Failed to install-write all apks
com.android.ddmlib.InstallException: Failed to install-write all apks
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:83)
at com.android.ddmlib.IDeviceSharedImpl.installPackages(IDeviceSharedImpl.java:395)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$36(DeviceImpl.java:1492)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1489)
at com.android.ddmlib.internal.DeviceImpl.lambda$installPackages$37(DeviceImpl.java:1504)
at com.android.ddmlib.internal.DeviceImpl.logRun3(DeviceImpl.java:1834)
at com.android.ddmlib.internal.DeviceImpl.installPackages(DeviceImpl.java:1500)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDevice.installPackages(DdmlibAndroidDevice.kt:74)
at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceController$executeAsync$deferred$1.invokeSuspend(DdmlibAndroidDeviceController.kt:254)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Try to use the simplest image as possible such as x86 then without Google APIs and add -no-accel
to start the emulator without VM acceleration.
# Configure Android SDK and Android Virtual Device (AVD)
- sdkmanager --list # Print the Android SDK's list of installed and available packages, install packages, and update packages https://developer.android.com/tools/sdkmanager#usage
- sdkmanager "system-images;android-21;default;x86" # Download an Android System Image
- echo no | avdmanager create avd -n EMU --abi default/x86 -k "system-images;android-21;default;x86" # Create an Android Virtual Device named EMU, the specified ABI and system image will be use for this emulator
# Start AVD without visual or audio output and block until device is online https://android.googlesource.com/platform/system/core/+/4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53/adb/commandline.c#143
- emulator -avd EMU -memory 2048 -cache-size 1000 -partition-size 6144 -wipe-data -no-accel -no-window -no-audio -no-boot-anim & adb wait-for-device
- adb devices -l # Check connected devices
- "./gradlew connectedAndroidTest mergeAndroidReports --continue"