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

detox test hangs when starting the Android emulator (Apple Silicon) #2772

Closed
1 task done
drash-course opened this issue May 6, 2021 · 37 comments
Closed
1 task done

Comments

@drash-course
Copy link

drash-course commented May 6, 2021

Describe the bug

We upgraded our Detox machine to the new M1 Mac mini and ran into this issue. detox build -c android.emu.debug succeeds without problems. detox test -c android.emu.debug starts but then hangs when the emulator window opens. The app does not launch. Here is the printout.

detox test -c android.emu.debug --loglevel trace --record-logs all

detox[21491] INFO:  [test.js] DETOX_CONFIGURATION="android.emu.debug" DETOX_FORCE_ADB_INSTALL=false DETOX_LOGLEVEL="trace" DETOX_READ_ONLY_EMU=false DETOX_RECORD_LOGS="all" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1620319503548 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
detox[21492] TRACE: [DETOX_CREATE] created a Detox instance with config:
{"artifactsConfig":{"rootDir":"artifacts/android.emu.debug.2021-05-06 16-45-03Z","plugins":{"log":{"enabled":true,"keepOnlyFailedTestsArtifacts":false},"screenshot":{"enabled":true,"shouldTakeAutomaticSnapshots":false,"keepOnlyFailedTestsArtifacts":false},"video":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"instruments":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"timeline":{"enabled":false},"uiHierarchy":{"enabled":false,"keepOnlyFailedTestsArtifacts":false}},"pathBuilder":{"_rootDir":"artifacts/android.emu.debug.2021-05-06 16-45-03Z"}},"appsConfig":{"default":{"type":"android.apk","binaryPath":"android/app/build/outputs/apk/dev/debug/app-dev-debug.apk","build":"cd android && ./gradlew assembleDevDebug assembleDevDebugAndroidTest -DtestBuildType=debug && cd .."}},"behaviorConfig":{"init":{"reinstallApp":true,"exposeGlobals":true},"cleanup":{"shutdownDevice":false},"launchApp":"auto"},"cliConfig":{"recordLogs":"all","configuration":"android.emu.debug","forceAdbInstall":"false","loglevel":"trace","useCustomLogger":"true"},"deviceConfig":{"type":"android.emulator","device":{"avdName":"Pixel_4_API_S"}},"runnerConfig":{"testRunner":"jest","runnerConfig":"e2e/config.json","specs":"e2e"},"sessionConfig":{"autoStart":true,"server":"ws://localhost:53897","sessionId":"739c184a-52ba-ed62-53c8-459377c997f9","debugSynchronization":10000},"errorComposer":{"configurationName":"android.emu.debug","filepath":"/Users/fleetback-ci/builds/9J-UT-y5/0/arhs-fleetback/fleetback-app-react/.detoxrc.json","contents":{"testRunner":"jest","runnerConfig":"e2e/config.json","configurations":{"ios.sim.debug":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/Fleetback DEV.app","build":"xcodebuild -workspace ios/FleetbackApp.xcworkspace -scheme FleetbackApp-DEV -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build","type":"ios.simulator","device":{"type":"iPhone 11"}},"ios.sim.release":{"binaryPath":"ios/build/Build/Products/Release-iphonesimulator/Fleetback DEV.app","build":"xcodebuild -workspace ios/FleetbackApp.xcworkspace -scheme FleetbackApp-DEV-release -configuration Release -sdk iphonesimulator -derivedDataPath ios/build","type":"ios.simulator","device":{"type":"iPhone 11"}},"android.emu.debug":{"binaryPath":"android/app/build/outputs/apk/dev/debug/app-dev-debug.apk","build":"cd android && ./gradlew assembleDevDebug assembleDevDebugAndroidTest -DtestBuildType=debug && cd ..","type":"android.emulator","device":{"avdName":"Pixel_4_API_S"}},"android.emu.release":{"binaryPath":"android/app/build/outputs/apk/dev/release/app-dev-release.apk","build":"cd android && ./gradlew assembleDevRelease assembleDevReleaseAndroidTest -DtestBuildType=release && cd ..","type":"android.emulator","device":{"avdName":"Pixel_4_API_S"}}}},"_extends":false}}
detox[21492] DEBUG: [WSS_CREATE] Detox server listening on localhost:53897...
detox[21492] DEBUG: [WSS_CONNECTION, #53898] registered a new connection.
detox[21492] TRACE: [WS_OPEN] opened web socket to: ws://localhost:53897
detox[21492] TRACE: [WS_SEND] {"type":"login","params":{"sessionId":"739c184a-52ba-ed62-53c8-459377c997f9","role":"tester"},"messageId":0}
detox[21492] TRACE: [WSS_GET_FROM, #53898] {"type":"login","params":{"sessionId":"739c184a-52ba-ed62-53c8-459377c997f9","role":"tester"},"messageId":0}
detox[21492] TRACE: [SESSION_CREATED] created session 739c184a-52ba-ed62-53c8-459377c997f9
detox[21492] TRACE: [WSS_SEND_TO, #tester] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
detox[21492] TRACE: [SESSION_JOINED] tester joined session 739c184a-52ba-ed62-53c8-459377c997f9
detox[21492] TRACE: [WS_MESSAGE] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
 
detox[21492] DEBUG: [EXEC_CMD, #0] "/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -list-avds --verbose
detox[21492] TRACE: [EXEC_SUCCESS, #0] Pixel_4_API_25
Pixel_4_API_S

detox[21492] DEBUG: [EXEC_CMD, #1] "/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version 
detox[21492] ERROR: [EXEC_FAIL, #1] ""/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version " failed with error = ChildProcessError: Command failed: "/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version 
 `"/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version ` (exited with error code 255) (code=255), stdout and stderr:

detox[21492] ERROR: [EXEC_FAIL, #1] emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: ERROR: can't find the emulator executable.


detox[21492] ERROR: [EXEC_FAIL, #1] 
detox[21492] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 30, minor: 3, patch: 5, toString: [Function: toString] }
detox[21492] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_4_API_S"
detox[21492] DEBUG: [EXEC_CMD, #2] "/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb"  devices
detox[21492] DEBUG: [EXEC_SUCCESS, #2] List of devices attached


detox[21492] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-17342
detox[21492] DEBUG: [SPAWN_CMD] /Users/fleetback-ci/Library/Android/sdk/emulator/emulator -verbose -no-audio -no-boot-anim -port 17342 @Pixel_4_API_S

 RUNS  e2e/firstTest.e2e.js

Building and running the iOS tests works. Both iOS and Android tests build, run and pass on our Intel MacBooks. I had to patch line 22 of EmulatorVersionResolver.js because the command seems broken but still prints the version so it's easy to workaround.

If you Cmd+Q the emulator, more logs appear. The whole logs are attached to the post.

If you don't have a M1 Mac to reproduce the problem, can you give us some pointers as to why the process can get stuck on the adb command? We can help debug and fix the problem.

Steps To Reproduce

  • I have tested this issue on the latest Detox release and it still reproduces
  1. create a basic react native project
  2. setup detox
  3. patch EmulatorVersionResolver.js with rawOutput = await (this._emulatorExec.exec(new QueryVersionCommand()).catch(e => e.stdout || e.stderr)) || '';
  4. run detox build -c android.emu.debug && detox test -c android.emu.debug
  5. it hangs

Expected behavior

It should launch the app and run the tests.

Detox Trace-Logs

See attached file detox_bug.txt

Device logs (adb logcat)

It says - waiting for device - and nothing happens. If you need them I can try with Android Studio.

Environment (please complete the following information):

  • Detox: 18.12.2
  • React Native: 0.64.1
  • Node: v14.16.1
  • Device: Emulated Pixel 4 API 31 arm64
  • OS: macOS 11.3 on the M1 Mac mini
  • Test-runner jest-circus
@d4vidi
Copy link
Collaborator

d4vidi commented May 10, 2021

Hey @drash-course,
I'm suspecting some environment setup issues, so here are some (related) follow-up questions:

  1. What happens if you run "/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version in a shell, regardless of Detox?

  2. It seems as though your emulator is launched, but something is slightly broken - because the adb server cannot find it. Can you try to launch an emulator in a shell? -
    a. over a specific port: /Users/fleetback-ci/Library/Android/sdk/emulator/emulator -verbose -no-audio -no-boot-anim -port 15776 @Pixel_4_API_S
    b. using an implicit port: /Users/fleetback-ci/Library/Android/sdk/emulator/emulator -verbose -no-audio -no-boot-anim @Pixel_4_API_S

in both cases, try to run adb devices and see whether the emulator's name shows up in the output (e.g. emulator-15776).

@drash-course
Copy link
Author

  1. "/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version returns with non zero exit code and the following in console.
emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: ERROR: can't find the emulator executable.

2a. Emulator launches but does not appear in add devices.

fleetback-ci@fleetback-ci-mini ~ % adb devices
List of devices attached

Here are the emulator logs.

fleetback-ci@fleetback-ci-mini ~ % /Users/fleetback-ci/Library/Android/sdk/emulator/emulator -verbose -no-audio -no-boot-anim -port 15776 @Pixel_4_API_S

emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: Found AVD name 'Pixel_4_API_S'
emulator: Found AVD target architecture: arm64
emulator: argv[0]: '/Users/fleetback-ci/Library/Android/sdk/emulator/emulator'; program directory: '/Users/fleetback-ci/Library/Android/sdk/emulator'
emulator: Found directory: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a/

emulator: emuDirName: '/Users/fleetback-ci/Library/Android/sdk/emulator'
emulator: try dir /Users/fleetback-ci/Library/Android/sdk/emulator
emulator: Trying emulator path '/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64'
emulator: Found target-specific 64-bit emulator binary: /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle9'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle11'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_swiftshader'
emulator: Adding library search path for Qt: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/qt/lib'
emulator: Silencing all qWarning(); use qCWarning(...) instead: QT_LOGGING_RULES=default.warning=false
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/qt/plugins
emulator: Setting Qt to use software OpenGL: QT_OPENGL=software
emulator: Setting QML to use software QtQuick2D: QMLSCENE_DEVICE=softwarecontext
emulator: Overriding pre-existing bad Qt high dpi settings...
emulator: Running :/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64
emulator: qemu backend: argv[00] = "/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64"
emulator: qemu backend: argv[01] = "-verbose"
emulator: qemu backend: argv[02] = "-no-audio"
emulator: qemu backend: argv[03] = "-no-boot-anim"
emulator: qemu backend: argv[04] = "-port"
emulator: qemu backend: argv[05] = "15776"
emulator: qemu backend: argv[06] = "@Pixel_4_API_S"
emulator: Concatenated backend parameters:
/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64 -verbose -no-audio -no-boot-anim -port 15776 @Pixel_4_API_S
emulator: autoconfig: -skin 1080x2280
emulator: autoconfig: -skindir (null)
emulator: autoconfig: -kernel /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu
emulator: Target arch = 'arm64'
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img
emulator: Using initial system image: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img
emulator: Using initial vendor image: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img
emulator: autoconfig: -data /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img
emulator: autoconfig: -initdata /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata.img
emulator: autoconfig: -cache /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img
emulator: INFO: ignore sdcard for arm at api level >= 30
emulator: Physical RAM size: 3000MB

emulator: VM heap size 1000MB is above maximum supported 576MB, setting it to that value
emulator: System image is read only
emulator: Found 2 DNS servers: 10.0.0.11 10.14.255.254
emulator: VERBOSE: FeatureControlImpl.cpp:172: WARNING: unexpected system image feature string, emulator might not function correctly, please try updating the emulator.

emulator: VERBOSE: FeatureControlImpl.cpp:175: Unexpected feature list:

emulator: VERBOSE: FeatureControlImpl.cpp:177: VirtconsoleLogcat
emulator: VERBOSE: FeatureControlImpl.cpp:177: VirtioVsockPipe
emulator: VERBOSE: FeatureControlImpl.cpp:177: Vulkan
emulator: VERBOSE: FeatureControlImpl.cpp:179:

emulator: found magic skin width=1080 height=2280 bpp=16

emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'qemu.cmdline' = 'androidboot.logcat=v:* androidboot.consolepipe=qemu_pipe,pipe:logcat'
emulator: Adding boot property: 'qemu.logcat' = 'start'
emulator: Requested console port 15776: Inferring adb port 15777.
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: Hypervisor.Framework OS X Version 11.3
handleCpuAcceleration: feature check for hvf
emulator: VERBOSE: modem_main.cpp:416: started modem simulator host server at port: 57010
emulator: GPU emulation enabled using 'host' mode
emulator: Initializing hardware OpenGLES emulation support
emulator: VERBOSE: MultiDisplay.cpp:325: create display 0
emulator: VERBOSE: MultiDisplay.cpp:414: setDisplayPose 0 x 0 y 0 w 1080 h 2280 dpi 0
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib: failed
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib: failed
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libMoltenVK.dylib: failed
added library /Users/fleetback-ci/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib
[mvk-info] MoltenVK version 1.1.1. Vulkan version 1.1.154.
The following 70 Vulkan extensions are supported:
VK_KHR_16bit_storage v1
VK_KHR_8bit_storage v1
VK_KHR_bind_memory2 v1
VK_KHR_create_renderpass2 v1
VK_KHR_dedicated_allocation v3
VK_KHR_depth_stencil_resolve v1
VK_KHR_descriptor_update_template v1
VK_KHR_device_group v4
VK_KHR_device_group_creation v1
VK_KHR_driver_properties v1
VK_KHR_external_fence v1
VK_KHR_external_fence_capabilities v1
VK_KHR_external_memory v1
VK_KHR_external_memory_capabilities v1
VK_KHR_external_semaphore v1
VK_KHR_external_semaphore_capabilities v1
VK_KHR_get_memory_requirements2 v1
VK_KHR_get_physical_device_properties2 v2
VK_KHR_get_surface_capabilities2 v1
VK_KHR_image_format_list v1
VK_KHR_maintenance1 v2
VK_KHR_maintenance2 v1
VK_KHR_maintenance3 v1
VK_KHR_multiview v1
VK_KHR_portability_subset v1
VK_KHR_push_descriptor v2
VK_KHR_relaxed_block_layout v1
VK_KHR_sampler_mirror_clamp_to_edge v3
VK_KHR_sampler_ycbcr_conversion v14
VK_KHR_shader_draw_parameters v1
VK_KHR_shader_float16_int8 v1
VK_KHR_shader_subgroup_extended_types v1
VK_KHR_storage_buffer_storage_class v1
VK_KHR_surface v25
VK_KHR_swapchain v70
VK_KHR_swapchain_mutable_format v1
VK_KHR_timeline_semaphore v2
VK_KHR_uniform_buffer_standard_layout v1
VK_KHR_variable_pointers v1
VK_EXT_debug_marker v4
VK_EXT_debug_report v9
VK_EXT_debug_utils v2
VK_EXT_descriptor_indexing v2
VK_EXT_fragment_shader_interlock v1
VK_EXT_hdr_metadata v2
VK_EXT_host_query_reset v1
VK_EXT_image_robustness v1
VK_EXT_inline_uniform_block v1
VK_EXT_memory_budget v1
VK_EXT_metal_surface v1
VK_EXT_post_depth_coverage v1
VK_EXT_private_data v1
VK_EXT_robustness2 v1
VK_EXT_scalar_block_layout v1
VK_EXT_shader_stencil_export v1
VK_EXT_shader_viewport_index_layer v1
VK_EXT_swapchain_colorspace v4
VK_EXT_texel_buffer_alignment v1
VK_EXT_texture_compression_astc_hdr v1
VK_EXT_vertex_attribute_divisor v3
VK_AMD_gpu_shader_half_float v2
VK_AMD_negative_viewport_height v1
VK_AMD_shader_image_load_store_lod v1
VK_AMD_shader_trinary_minmax v1
VK_IMG_format_pvrtc v1
VK_INTEL_shader_integer_functions2 v1
VK_GOOGLE_display_timing v1
VK_MVK_macos_surface v3
VK_MVK_moltenvk v29
VK_NV_glsl_shader v1
[mvk-info] GPU device:
model: Apple M1
type: Discrete
vendorID: 0x106b
deviceID: 0xa140
pipelineCacheUUID: 00002775-0400-03EF-9EC6-7EDC4219F216
supports the following Metal Versions, GPU's and Feature Sets:
Metal Shading Language 2.3
GPU Family Apple 7
GPU Family Apple 6
GPU Family Apple 5
GPU Family Apple 4
GPU Family Apple 3
GPU Family Apple 2
GPU Family Apple 1
GPU Family Mac 2
GPU Family Mac 1
GPU Family Common 3
GPU Family Common 2
GPU Family Common 1
macOS GPU Family 2 v1
macOS GPU Family 1 v4
macOS GPU Family 1 v3
macOS GPU Family 1 v2
macOS GPU Family 1 v1
[mvk-info] Created VkInstance with the following 0 Vulkan extensions enabled:
[mvk-info] Using MTLFence for Vulkan semaphores.
[mvk-info] Created VkDevice to run on GPU Apple M1 with the following 0 Vulkan extensions enabled:
emulator: INFO: ignore sdcard for arm at api level >= 30
emulator: Found 2 DNS servers: 10.0.0.11 10.14.255.254
Content of hardware configuration file:
hw.cpu.arch = arm64
hw.cpu.ncore = 4
hw.ramSize = 3000
hw.screen = multi-touch
hw.mainKeys = false
hw.trackBall = false
hw.keyboard = true
hw.keyboard.lid = false
hw.keyboard.charmap = qwerty2
hw.dPad = false
hw.rotaryInput = false
hw.gsmModem = true
hw.gps = true
hw.battery = true
hw.accelerometer = true
hw.gyroscope = true
hw.audioInput = true
hw.audioOutput = true
hw.sdCard = true
disk.cachePartition = true
disk.cachePartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img
disk.cachePartition.size = 66m
test.quitAfterBootTimeOut = -1
test.delayAdbTillBootComplete = 0
test.monitorAdb = 0
hw.lcd.width = 1080
hw.lcd.height = 2280
hw.lcd.depth = 16
hw.lcd.density = 440
hw.lcd.backlight = true
hw.lcd.vsync = 60
hw.gltransport = pipe
hw.gltransport.asg.writeBufferSize = 1048576
hw.gltransport.asg.writeStepSize = 4096
hw.gltransport.asg.dataRingSize = 32768
hw.gltransport.drawFlushInterval = 800
hw.displayRegion.0.1.xOffset = -1
hw.displayRegion.0.1.yOffset = -1
hw.displayRegion.0.1.width = 0
hw.displayRegion.0.1.height = 0
hw.displayRegion.0.2.xOffset = -1
hw.displayRegion.0.2.yOffset = -1
hw.displayRegion.0.2.width = 0
hw.displayRegion.0.2.height = 0
hw.displayRegion.0.3.xOffset = -1
hw.displayRegion.0.3.yOffset = -1
hw.displayRegion.0.3.width = 0
hw.displayRegion.0.3.height = 0
hw.display1.width = 0
hw.display1.height = 0
hw.display1.density = 0
hw.display1.xOffset = -1
hw.display1.yOffset = -1
hw.display1.flag = 0
hw.display2.width = 0
hw.display2.height = 0
hw.display2.density = 0
hw.display2.xOffset = -1
hw.display2.yOffset = -1
hw.display2.flag = 0
hw.display3.width = 0
hw.display3.height = 0
hw.display3.density = 0
hw.display3.xOffset = -1
hw.display3.yOffset = -1
hw.display3.flag = 0
hw.gpu.enabled = true
hw.gpu.mode = host
hw.initialOrientation = Portrait
hw.camera.back = emulated
hw.camera.front = emulated
vm.heapSize = 576
hw.sensors.light = true
hw.sensors.pressure = true
hw.sensors.humidity = true
hw.sensors.proximity = true
hw.sensors.magnetic_field = true
hw.sensors.magnetic_field_uncalibrated = true
hw.sensors.gyroscope_uncalibrated = true
hw.sensors.orientation = true
hw.sensors.temperature = true
hw.sensor.hinge = true
hw.sensor.hinge.count = 0
hw.sensor.hinge.type = 0
hw.sensor.hinge.sub_type = 0
hw.sensor.hinge.fold_to_displayRegion.0.1_at_posture = 1
hw.sensor.roll = false
hw.sensor.roll.count = 0
hw.sensor.roll.resize_to_displayRegion.0.1_at_posture = 6
hw.sensor.roll.resize_to_displayRegion.0.2_at_posture = 6
hw.sensor.roll.resize_to_displayRegion.0.3_at_posture = 6
hw.sensors.heart_rate = true
hw.useext4 = true
hw.arc = false
hw.arc.autologin = false
kernel.path = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu
kernel.newDeviceNaming = yes
kernel.supportsYaffs2 = no
disk.ramdisk.path = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img
disk.systemPartition.initPath = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img
disk.systemPartition.size = 4107m
disk.vendorPartition.initPath = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img
disk.vendorPartition.size = 800m
disk.dataPartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img
disk.dataPartition.size = 800m
disk.encryptionKeyPartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img
PlayStore.enabled = false
avd.name = Pixel_4_API_S
avd.id = Pixel_4_API_S
fastboot.forceColdBoot = false
android.sdk.root = /Users/fleetback-ci/Library/Android/sdk
android.avd.home = /Users/fleetback-ci/.android/avd
.
QEMU options list:
emulator: argv[00] = "/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64"
emulator: argv[01] = "-dns-server"
emulator: argv[02] = "10.0.0.11,10.14.255.254"
emulator: argv[03] = "-no-audio"
emulator: argv[04] = "-serial"
emulator: argv[05] = "null"
emulator: argv[06] = "-android-ports"
emulator: argv[07] = "15776,15777"
emulator: argv[08] = "-cpu"
emulator: argv[09] = "cortex-a53"
emulator: argv[10] = "-machine"
emulator: argv[11] = "type=virt"
emulator: argv[12] = "-enable-hvf"
emulator: argv[13] = "-smp"
emulator: argv[14] = "cores=4"
emulator: argv[15] = "-m"
emulator: argv[16] = "3000"
emulator: argv[17] = "-lcd-density"
emulator: argv[18] = "440"
emulator: argv[19] = "-nodefaults"
emulator: argv[20] = "-kernel"
emulator: argv[21] = "/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu"
emulator: argv[22] = "-initrd"
emulator: argv[23] = "/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img"
emulator: argv[24] = "-drive"
emulator: argv[25] = "index=0,id=vendor,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img,read-only"
emulator: argv[26] = "-device"
emulator: argv[27] = "virtio-blk-device,drive=vendor"
emulator: argv[28] = "-drive"
emulator: argv[29] = "index=1,id=encrypt,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[30] = "-device"
emulator: argv[31] = "virtio-blk-device,drive=encrypt"
emulator: argv[32] = "-drive"
emulator: argv[33] = "index=2,id=userdata,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[34] = "-device"
emulator: argv[35] = "virtio-blk-device,drive=userdata"
emulator: argv[36] = "-drive"
emulator: argv[37] = "index=3,id=cache,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[38] = "-device"
emulator: argv[39] = "virtio-blk-device,drive=cache"
emulator: argv[40] = "-drive"
emulator: argv[41] = "index=4,id=system,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img,read-only"
emulator: argv[42] = "-device"
emulator: argv[43] = "virtio-blk-device,drive=system"
emulator: argv[44] = "-netdev"
emulator: argv[45] = "user,id=mynet"
emulator: argv[46] = "-device"
emulator: argv[47] = "virtio-net-device,netdev=mynet"
emulator: argv[48] = "-device"
emulator: argv[49] = "virtio-serial"
emulator: argv[50] = "-chardev"
emulator: argv[51] = "socket,port=57009,host=localhost,nowait,nodelay,ipv6,id=modem"
emulator: argv[52] = "-device"
emulator: argv[53] = "virtserialport,chardev=modem,name=modem"
emulator: argv[54] = "-device"
emulator: argv[55] = "virtio-rng-device"
emulator: argv[56] = "-show-cursor"
emulator: argv[57] = "-device"
emulator: argv[58] = "virtio_input_multi_touch_pci_1"
emulator: argv[59] = "-device"
emulator: argv[60] = "virtio_input_multi_touch_pci_2"
emulator: argv[61] = "-device"
emulator: argv[62] = "virtio_input_multi_touch_pci_3"
emulator: argv[63] = "-device"
emulator: argv[64] = "virtio_input_multi_touch_pci_4"
emulator: argv[65] = "-device"
emulator: argv[66] = "virtio_input_multi_touch_pci_5"
emulator: argv[67] = "-device"
emulator: argv[68] = "virtio_input_multi_touch_pci_6"
emulator: argv[69] = "-device"
emulator: argv[70] = "virtio_input_multi_touch_pci_7"
emulator: argv[71] = "-device"
emulator: argv[72] = "virtio_input_multi_touch_pci_8"
emulator: argv[73] = "-device"
emulator: argv[74] = "virtio_input_multi_touch_pci_9"
emulator: argv[75] = "-device"
emulator: argv[76] = "virtio_input_multi_touch_pci_10"
emulator: argv[77] = "-device"
emulator: argv[78] = "virtio_input_multi_touch_pci_11"
emulator: argv[79] = "-device"
emulator: argv[80] = "virtio-keyboard-pci"
emulator: argv[81] = "-L"
emulator: argv[82] = "/Users/fleetback-ci/Library/Android/sdk/emulator/lib/pc-bios"
emulator: argv[83] = "-soundhw"
emulator: argv[84] = "hda"
emulator: argv[85] = "-append"
emulator: argv[86] = "qemu=1 no_timer_check androidboot.hardware=ranchu androidboot.serialno=EMULATOR30X3X5X0 keep_bootcon earlyprintk=ttyAMA0 android.qemud=1 console=0 android.checkjni=1 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl cma=294M@0-4G ndns=2 qemu.wifi=1 mac80211_hwsim.channels=2 loop.max_part=7 androidboot.vbmeta.size=6144 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=080fb1fc0e493ad9f013367f2bdd017c6058a2f3ce698b43ac36707ff3b1331c androidboot.boot_devices=a003600.virtio_mmio qemu.dalvik.vm.heapsize=576m qemu.camera_protocol_ver=1 printk.devkmsg=on"
emulator: argv[87] = "-android-hw"
emulator: argv[88] = "/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/hardware-qemu.ini"
Concatenated QEMU options:
/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64 -dns-server 10.0.0.11,10.14.255.254 -no-audio -serial null -android-ports 15776,15777 -cpu cortex-a53 -machine type=virt -enable-hvf -smp cores=4 -m 3000 -lcd-density 440 -nodefaults -kernel /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu -initrd /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img -drive index=0,id=vendor,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img,read-only -device virtio-blk-device,drive=vendor -drive index=1,id=encrypt,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=encrypt -drive index=2,id=userdata,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=userdata -drive index=3,id=cache,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=cache -drive index=4,id=system,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img,read-only -device virtio-blk-device,drive=system -netdev user,id=mynet -device virtio-net-device,netdev=mynet -device virtio-serial -chardev socket,port=57009,host=localhost,nowait,nodelay,ipv6,id=modem -device virtserialport,chardev=modem,name=modem -device virtio-rng-device -show-cursor -device virtio_input_multi_touch_pci_1 -device virtio_input_multi_touch_pci_2 -device virtio_input_multi_touch_pci_3 -device virtio_input_multi_touch_pci_4 -device virtio_input_multi_touch_pci_5 -device virtio_input_multi_touch_pci_6 -device virtio_input_multi_touch_pci_7 -device virtio_input_multi_touch_pci_8 -device virtio_input_multi_touch_pci_9 -device virtio_input_multi_touch_pci_10 -device virtio_input_multi_touch_pci_11 -device virtio-keyboard-pci -L /Users/fleetback-ci/Library/Android/sdk/emulator/lib/pc-bios -soundhw hda -append 'qemu=1 no_timer_check androidboot.hardware=ranchu androidboot.serialno=EMULATOR30X3X5X0 keep_bootcon earlyprintk=ttyAMA0 android.qemud=1 console=0 android.checkjni=1 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl cma=294M@0-4G ndns=2 qemu.wifi=1 mac80211_hwsim.channels=2 loop.max_part=7 androidboot.vbmeta.size=6144 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=080fb1fc0e493ad9f013367f2bdd017c6058a2f3ce698b43ac36707ff3b1331c androidboot.boot_devices=a003600.virtio_mmio qemu.dalvik.vm.heapsize=576m qemu.camera_protocol_ver=1 printk.devkmsg=on' -android-hw /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/hardware-qemu.ini
emulator: Android qemu version 30.3.5.0 (build_id 7036990) (CL:N/A)

emulator: Starting QEMU main loop
emulator: Adding boot property: 'ro.opengles.version' = '196608'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'both'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '576m'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '440'
emulator: goldfish_events.have-dpad: false
emulator: goldfish_events.have-trackball: false
emulator: goldfish_events.have-camera: true
emulator: goldfish_events.have-keyboard: false
emulator: goldfish_events.have-lidswitch: false
emulator: goldfish_events.have-tabletmode: false
emulator: goldfish_events.have-touch: false
emulator: goldfish_events.have-multitouch: false
emulator: Adding boot property: 'net.wifi_mac_prefix' = '15776'
emulator: WARNING: Requested adb port (15777) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
Not using any http proxy
emulator: Adding boot property: 'qemu.timezone' = 'Europe/Luxembourg'
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized

emulator: emulator_window_fb_rotate

emulator: VERBOSE: MultiDisplay.cpp:695: config multidisplay with config.ini 0x0 0x0 0x0
emulator: VERBOSE: AdbInterface.cpp:386: Found: 3 adb executables
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: OpenGL Vendor=[Google (Apple)]
emulator: OpenGL Renderer=[Android Emulator OpenGL ES Translator (Apple M1)]
emulator: OpenGL Version=[OpenGL ES 3.0 (4.1 Metal - 71.5.9)]
emulator: INFO: ignore sdcard for arm at api level >= 30
checkValid: hw configs not eq
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
Your emulator is out of date, please update by launching Android Studio:

  • Start Android Studio
  • Select menu "Tools > Android > SDK Manager"
  • Click "SDK Tools" tab
  • Check "Android Emulator" checkbox
  • Click "OK"

emulator: _hwFingerprint_connect: connect finger print listen is called

emulator: got message from guest system fingerprint HAL

emulator: INFO: boot completed
emulator: INFO: boot time 14689 ms
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: Revoking microphone permissions for Google App.
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: INFO: QtLogger.cpp:68: Warning: Failed to get QCocoaScreen for NSObject(0x0) ((null):0, (null))

emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037

2b. Emulator launches and adb devices finds it but offline.

fleetback-ci@fleetback-ci-mini ~ % adb devices
List of devices attached
emulator-5554	offline

Here are the emulator logs.

fleetback-ci@fleetback-ci-mini ~ % /Users/fleetback-ci/Library/Android/sdk/emulator/emulator -verbose -no-audio -no-boot-anim @Pixel_4_API_S

emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: Found AVD name 'Pixel_4_API_S'
emulator: Found AVD target architecture: arm64
emulator: argv[0]: '/Users/fleetback-ci/Library/Android/sdk/emulator/emulator'; program directory: '/Users/fleetback-ci/Library/Android/sdk/emulator'
emulator: Found directory: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a/

emulator: emuDirName: '/Users/fleetback-ci/Library/Android/sdk/emulator'
emulator: try dir /Users/fleetback-ci/Library/Android/sdk/emulator
emulator: Trying emulator path '/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64'
emulator: Found target-specific 64-bit emulator binary: /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle9'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_angle11'
emulator: Adding library search path: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/gles_swiftshader'
emulator: Adding library search path for Qt: '/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/qt/lib'
emulator: Silencing all qWarning(); use qCWarning(...) instead: QT_LOGGING_RULES=default.warning=false
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/Users/fleetback-ci/Library/Android/sdk/emulator/lib64/qt/plugins
emulator: Setting Qt to use software OpenGL: QT_OPENGL=software
emulator: Setting QML to use software QtQuick2D: QMLSCENE_DEVICE=softwarecontext
emulator: Overriding pre-existing bad Qt high dpi settings...
emulator: Running :/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64
emulator: qemu backend: argv[00] = "/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64"
emulator: qemu backend: argv[01] = "-verbose"
emulator: qemu backend: argv[02] = "-no-audio"
emulator: qemu backend: argv[03] = "-no-boot-anim"
emulator: qemu backend: argv[04] = "@Pixel_4_API_S"
emulator: Concatenated backend parameters:
/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64 -verbose -no-audio -no-boot-anim @Pixel_4_API_S
emulator: autoconfig: -skin 1080x2280
emulator: autoconfig: -skindir (null)
emulator: autoconfig: -kernel /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu
emulator: Target arch = 'arm64'
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img
emulator: Using initial system image: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img
emulator: Using initial vendor image: /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img
emulator: autoconfig: -data /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img
emulator: autoconfig: -initdata /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata.img
emulator: autoconfig: -cache /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img
emulator: INFO: ignore sdcard for arm at api level >= 30
emulator: Physical RAM size: 3000MB

emulator: VM heap size 1000MB is above maximum supported 576MB, setting it to that value
emulator: System image is read only
emulator: Found 2 DNS servers: 10.0.0.11 10.14.255.254
emulator: VERBOSE: FeatureControlImpl.cpp:172: WARNING: unexpected system image feature string, emulator might not function correctly, please try updating the emulator.

emulator: VERBOSE: FeatureControlImpl.cpp:175: Unexpected feature list:

emulator: VERBOSE: FeatureControlImpl.cpp:177: VirtconsoleLogcat
emulator: VERBOSE: FeatureControlImpl.cpp:177: VirtioVsockPipe
emulator: VERBOSE: FeatureControlImpl.cpp:177: Vulkan
emulator: VERBOSE: FeatureControlImpl.cpp:179:

emulator: found magic skin width=1080 height=2280 bpp=16

emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'qemu.cmdline' = 'androidboot.logcat=v:* androidboot.consolepipe=qemu_pipe,pipe:logcat'
emulator: Adding boot property: 'qemu.logcat' = 'start'
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: Hypervisor.Framework OS X Version 11.3
handleCpuAcceleration: feature check for hvf
emulator: VERBOSE: modem_main.cpp:416: started modem simulator host server at port: 57293
emulator: GPU emulation enabled using 'host' mode
emulator: Initializing hardware OpenGLES emulation support
emulator: VERBOSE: MultiDisplay.cpp:325: create display 0
emulator: VERBOSE: MultiDisplay.cpp:414: setDisplayPose 0 x 0 y 0 w 1080 h 2280 dpi 0
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib: failed
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib: failed
cannot add library /Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/lib64/vulkan/libMoltenVK.dylib: failed
added library /Users/fleetback-ci/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib
[mvk-info] MoltenVK version 1.1.1. Vulkan version 1.1.154.
The following 70 Vulkan extensions are supported:
VK_KHR_16bit_storage v1
VK_KHR_8bit_storage v1
VK_KHR_bind_memory2 v1
VK_KHR_create_renderpass2 v1
VK_KHR_dedicated_allocation v3
VK_KHR_depth_stencil_resolve v1
VK_KHR_descriptor_update_template v1
VK_KHR_device_group v4
VK_KHR_device_group_creation v1
VK_KHR_driver_properties v1
VK_KHR_external_fence v1
VK_KHR_external_fence_capabilities v1
VK_KHR_external_memory v1
VK_KHR_external_memory_capabilities v1
VK_KHR_external_semaphore v1
VK_KHR_external_semaphore_capabilities v1
VK_KHR_get_memory_requirements2 v1
VK_KHR_get_physical_device_properties2 v2
VK_KHR_get_surface_capabilities2 v1
VK_KHR_image_format_list v1
VK_KHR_maintenance1 v2
VK_KHR_maintenance2 v1
VK_KHR_maintenance3 v1
VK_KHR_multiview v1
VK_KHR_portability_subset v1
VK_KHR_push_descriptor v2
VK_KHR_relaxed_block_layout v1
VK_KHR_sampler_mirror_clamp_to_edge v3
VK_KHR_sampler_ycbcr_conversion v14
VK_KHR_shader_draw_parameters v1
VK_KHR_shader_float16_int8 v1
VK_KHR_shader_subgroup_extended_types v1
VK_KHR_storage_buffer_storage_class v1
VK_KHR_surface v25
VK_KHR_swapchain v70
VK_KHR_swapchain_mutable_format v1
VK_KHR_timeline_semaphore v2
VK_KHR_uniform_buffer_standard_layout v1
VK_KHR_variable_pointers v1
VK_EXT_debug_marker v4
VK_EXT_debug_report v9
VK_EXT_debug_utils v2
VK_EXT_descriptor_indexing v2
VK_EXT_fragment_shader_interlock v1
VK_EXT_hdr_metadata v2
VK_EXT_host_query_reset v1
VK_EXT_image_robustness v1
VK_EXT_inline_uniform_block v1
VK_EXT_memory_budget v1
VK_EXT_metal_surface v1
VK_EXT_post_depth_coverage v1
VK_EXT_private_data v1
VK_EXT_robustness2 v1
VK_EXT_scalar_block_layout v1
VK_EXT_shader_stencil_export v1
VK_EXT_shader_viewport_index_layer v1
VK_EXT_swapchain_colorspace v4
VK_EXT_texel_buffer_alignment v1
VK_EXT_texture_compression_astc_hdr v1
VK_EXT_vertex_attribute_divisor v3
VK_AMD_gpu_shader_half_float v2
VK_AMD_negative_viewport_height v1
VK_AMD_shader_image_load_store_lod v1
VK_AMD_shader_trinary_minmax v1
VK_IMG_format_pvrtc v1
VK_INTEL_shader_integer_functions2 v1
VK_GOOGLE_display_timing v1
VK_MVK_macos_surface v3
VK_MVK_moltenvk v29
VK_NV_glsl_shader v1
[mvk-info] GPU device:
model: Apple M1
type: Discrete
vendorID: 0x106b
deviceID: 0xa140
pipelineCacheUUID: 00002775-0400-03EF-9EC6-7EDC4219F216
supports the following Metal Versions, GPU's and Feature Sets:
Metal Shading Language 2.3
GPU Family Apple 7
GPU Family Apple 6
GPU Family Apple 5
GPU Family Apple 4
GPU Family Apple 3
GPU Family Apple 2
GPU Family Apple 1
GPU Family Mac 2
GPU Family Mac 1
GPU Family Common 3
GPU Family Common 2
GPU Family Common 1
macOS GPU Family 2 v1
macOS GPU Family 1 v4
macOS GPU Family 1 v3
macOS GPU Family 1 v2
macOS GPU Family 1 v1
[mvk-info] Created VkInstance with the following 0 Vulkan extensions enabled:
[mvk-info] Using MTLFence for Vulkan semaphores.
[mvk-info] Created VkDevice to run on GPU Apple M1 with the following 0 Vulkan extensions enabled:
emulator: INFO: ignore sdcard for arm at api level >= 30
emulator: Found 2 DNS servers: 10.0.0.11 10.14.255.254
Content of hardware configuration file:
hw.cpu.arch = arm64
hw.cpu.ncore = 4
hw.ramSize = 3000
hw.screen = multi-touch
hw.mainKeys = false
hw.trackBall = false
hw.keyboard = true
hw.keyboard.lid = false
hw.keyboard.charmap = qwerty2
hw.dPad = false
hw.rotaryInput = false
hw.gsmModem = true
hw.gps = true
hw.battery = true
hw.accelerometer = true
hw.gyroscope = true
hw.audioInput = true
hw.audioOutput = true
hw.sdCard = true
disk.cachePartition = true
disk.cachePartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img
disk.cachePartition.size = 66m
test.quitAfterBootTimeOut = -1
test.delayAdbTillBootComplete = 0
test.monitorAdb = 0
hw.lcd.width = 1080
hw.lcd.height = 2280
hw.lcd.depth = 16
hw.lcd.density = 440
hw.lcd.backlight = true
hw.lcd.vsync = 60
hw.gltransport = pipe
hw.gltransport.asg.writeBufferSize = 1048576
hw.gltransport.asg.writeStepSize = 4096
hw.gltransport.asg.dataRingSize = 32768
hw.gltransport.drawFlushInterval = 800
hw.displayRegion.0.1.xOffset = -1
hw.displayRegion.0.1.yOffset = -1
hw.displayRegion.0.1.width = 0
hw.displayRegion.0.1.height = 0
hw.displayRegion.0.2.xOffset = -1
hw.displayRegion.0.2.yOffset = -1
hw.displayRegion.0.2.width = 0
hw.displayRegion.0.2.height = 0
hw.displayRegion.0.3.xOffset = -1
hw.displayRegion.0.3.yOffset = -1
hw.displayRegion.0.3.width = 0
hw.displayRegion.0.3.height = 0
hw.display1.width = 0
hw.display1.height = 0
hw.display1.density = 0
hw.display1.xOffset = -1
hw.display1.yOffset = -1
hw.display1.flag = 0
hw.display2.width = 0
hw.display2.height = 0
hw.display2.density = 0
hw.display2.xOffset = -1
hw.display2.yOffset = -1
hw.display2.flag = 0
hw.display3.width = 0
hw.display3.height = 0
hw.display3.density = 0
hw.display3.xOffset = -1
hw.display3.yOffset = -1
hw.display3.flag = 0
hw.gpu.enabled = true
hw.gpu.mode = host
hw.initialOrientation = Portrait
hw.camera.back = emulated
hw.camera.front = emulated
vm.heapSize = 576
hw.sensors.light = true
hw.sensors.pressure = true
hw.sensors.humidity = true
hw.sensors.proximity = true
hw.sensors.magnetic_field = true
hw.sensors.magnetic_field_uncalibrated = true
hw.sensors.gyroscope_uncalibrated = true
hw.sensors.orientation = true
hw.sensors.temperature = true
hw.sensor.hinge = true
hw.sensor.hinge.count = 0
hw.sensor.hinge.type = 0
hw.sensor.hinge.sub_type = 0
hw.sensor.hinge.fold_to_displayRegion.0.1_at_posture = 1
hw.sensor.roll = false
hw.sensor.roll.count = 0
hw.sensor.roll.resize_to_displayRegion.0.1_at_posture = 6
hw.sensor.roll.resize_to_displayRegion.0.2_at_posture = 6
hw.sensor.roll.resize_to_displayRegion.0.3_at_posture = 6
hw.sensors.heart_rate = true
hw.useext4 = true
hw.arc = false
hw.arc.autologin = false
kernel.path = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu
kernel.newDeviceNaming = yes
kernel.supportsYaffs2 = no
disk.ramdisk.path = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img
disk.systemPartition.initPath = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img
disk.systemPartition.size = 4107m
disk.vendorPartition.initPath = /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img
disk.vendorPartition.size = 800m
disk.dataPartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img
disk.dataPartition.size = 800m
disk.encryptionKeyPartition.path = /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img
PlayStore.enabled = false
avd.name = Pixel_4_API_S
avd.id = Pixel_4_API_S
fastboot.forceColdBoot = false
android.sdk.root = /Users/fleetback-ci/Library/Android/sdk
android.avd.home = /Users/fleetback-ci/.android/avd
.
QEMU options list:
emulator: argv[00] = "/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64"
emulator: argv[01] = "-dns-server"
emulator: argv[02] = "10.0.0.11,10.14.255.254"
emulator: argv[03] = "-no-audio"
emulator: argv[04] = "-serial"
emulator: argv[05] = "null"
emulator: argv[06] = "-cpu"
emulator: argv[07] = "cortex-a53"
emulator: argv[08] = "-machine"
emulator: argv[09] = "type=virt"
emulator: argv[10] = "-enable-hvf"
emulator: argv[11] = "-smp"
emulator: argv[12] = "cores=4"
emulator: argv[13] = "-m"
emulator: argv[14] = "3000"
emulator: argv[15] = "-lcd-density"
emulator: argv[16] = "440"
emulator: argv[17] = "-nodefaults"
emulator: argv[18] = "-kernel"
emulator: argv[19] = "/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu"
emulator: argv[20] = "-initrd"
emulator: argv[21] = "/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img"
emulator: argv[22] = "-drive"
emulator: argv[23] = "index=0,id=vendor,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img,read-only"
emulator: argv[24] = "-device"
emulator: argv[25] = "virtio-blk-device,drive=vendor"
emulator: argv[26] = "-drive"
emulator: argv[27] = "index=1,id=encrypt,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[28] = "-device"
emulator: argv[29] = "virtio-blk-device,drive=encrypt"
emulator: argv[30] = "-drive"
emulator: argv[31] = "index=2,id=userdata,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[32] = "-device"
emulator: argv[33] = "virtio-blk-device,drive=userdata"
emulator: argv[34] = "-drive"
emulator: argv[35] = "index=3,id=cache,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[36] = "-device"
emulator: argv[37] = "virtio-blk-device,drive=cache"
emulator: argv[38] = "-drive"
emulator: argv[39] = "index=4,id=system,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img,read-only"
emulator: argv[40] = "-device"
emulator: argv[41] = "virtio-blk-device,drive=system"
emulator: argv[42] = "-netdev"
emulator: argv[43] = "user,id=mynet"
emulator: argv[44] = "-device"
emulator: argv[45] = "virtio-net-device,netdev=mynet"
emulator: argv[46] = "-device"
emulator: argv[47] = "virtio-serial"
emulator: argv[48] = "-chardev"
emulator: argv[49] = "socket,port=57292,host=localhost,nowait,nodelay,ipv6,id=modem"
emulator: argv[50] = "-device"
emulator: argv[51] = "virtserialport,chardev=modem,name=modem"
emulator: argv[52] = "-device"
emulator: argv[53] = "virtio-rng-device"
emulator: argv[54] = "-show-cursor"
emulator: argv[55] = "-device"
emulator: argv[56] = "virtio_input_multi_touch_pci_1"
emulator: argv[57] = "-device"
emulator: argv[58] = "virtio_input_multi_touch_pci_2"
emulator: argv[59] = "-device"
emulator: argv[60] = "virtio_input_multi_touch_pci_3"
emulator: argv[61] = "-device"
emulator: argv[62] = "virtio_input_multi_touch_pci_4"
emulator: argv[63] = "-device"
emulator: argv[64] = "virtio_input_multi_touch_pci_5"
emulator: argv[65] = "-device"
emulator: argv[66] = "virtio_input_multi_touch_pci_6"
emulator: argv[67] = "-device"
emulator: argv[68] = "virtio_input_multi_touch_pci_7"
emulator: argv[69] = "-device"
emulator: argv[70] = "virtio_input_multi_touch_pci_8"
emulator: argv[71] = "-device"
emulator: argv[72] = "virtio_input_multi_touch_pci_9"
emulator: argv[73] = "-device"
emulator: argv[74] = "virtio_input_multi_touch_pci_10"
emulator: argv[75] = "-device"
emulator: argv[76] = "virtio_input_multi_touch_pci_11"
emulator: argv[77] = "-device"
emulator: argv[78] = "virtio-keyboard-pci"
emulator: argv[79] = "-L"
emulator: argv[80] = "/Users/fleetback-ci/Library/Android/sdk/emulator/lib/pc-bios"
emulator: argv[81] = "-soundhw"
emulator: argv[82] = "hda"
emulator: argv[83] = "-append"
emulator: argv[84] = "qemu=1 no_timer_check androidboot.hardware=ranchu androidboot.serialno=EMULATOR30X3X5X0 keep_bootcon earlyprintk=ttyAMA0 android.qemud=1 console=0 android.checkjni=1 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl cma=294M@0-4G ndns=2 qemu.wifi=1 mac80211_hwsim.channels=2 loop.max_part=7 androidboot.vbmeta.size=6144 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=080fb1fc0e493ad9f013367f2bdd017c6058a2f3ce698b43ac36707ff3b1331c androidboot.boot_devices=a003600.virtio_mmio qemu.dalvik.vm.heapsize=576m qemu.camera_protocol_ver=1 printk.devkmsg=on"
emulator: argv[85] = "-android-hw"
emulator: argv[86] = "/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/hardware-qemu.ini"
Concatenated QEMU options:
/Users/fleetback-ci/Library/Android/sdk/emulator/qemu/darwin-aarch64/qemu-system-aarch64 -dns-server 10.0.0.11,10.14.255.254 -no-audio -serial null -cpu cortex-a53 -machine type=virt -enable-hvf -smp cores=4 -m 3000 -lcd-density 440 -nodefaults -kernel /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//kernel-ranchu -initrd /Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//ramdisk.img -drive index=0,id=vendor,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//vendor.img,read-only -device virtio-blk-device,drive=vendor -drive index=1,id=encrypt,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=encrypt -drive index=2,id=userdata,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=userdata -drive index=3,id=cache,if=none,file=/Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-device,drive=cache -drive index=4,id=system,if=none,file=/Users/fleetback-ci/Library/Android/sdk/system-images/android-S/google_apis/arm64-v8a//system.img,read-only -device virtio-blk-device,drive=system -netdev user,id=mynet -device virtio-net-device,netdev=mynet -device virtio-serial -chardev socket,port=57292,host=localhost,nowait,nodelay,ipv6,id=modem -device virtserialport,chardev=modem,name=modem -device virtio-rng-device -show-cursor -device virtio_input_multi_touch_pci_1 -device virtio_input_multi_touch_pci_2 -device virtio_input_multi_touch_pci_3 -device virtio_input_multi_touch_pci_4 -device virtio_input_multi_touch_pci_5 -device virtio_input_multi_touch_pci_6 -device virtio_input_multi_touch_pci_7 -device virtio_input_multi_touch_pci_8 -device virtio_input_multi_touch_pci_9 -device virtio_input_multi_touch_pci_10 -device virtio_input_multi_touch_pci_11 -device virtio-keyboard-pci -L /Users/fleetback-ci/Library/Android/sdk/emulator/lib/pc-bios -soundhw hda -append 'qemu=1 no_timer_check androidboot.hardware=ranchu androidboot.serialno=EMULATOR30X3X5X0 keep_bootcon earlyprintk=ttyAMA0 android.qemud=1 console=0 android.checkjni=1 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl cma=294M@0-4G ndns=2 qemu.wifi=1 mac80211_hwsim.channels=2 loop.max_part=7 androidboot.vbmeta.size=6144 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=080fb1fc0e493ad9f013367f2bdd017c6058a2f3ce698b43ac36707ff3b1331c androidboot.boot_devices=a003600.virtio_mmio qemu.dalvik.vm.heapsize=576m qemu.camera_protocol_ver=1 printk.devkmsg=on' -android-hw /Users/fleetback-ci/.android/avd/Pixel_4_API_S.avd/hardware-qemu.ini
emulator: Android qemu version 30.3.5.0 (build_id 7036990) (CL:N/A)

emulator: Starting QEMU main loop
emulator: Adding boot property: 'ro.opengles.version' = '196608'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'both'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '576m'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '440'
emulator: goldfish_events.have-dpad: false
emulator: goldfish_events.have-trackball: false
emulator: goldfish_events.have-camera: true
emulator: goldfish_events.have-keyboard: false
emulator: goldfish_events.have-lidswitch: false
emulator: goldfish_events.have-tabletmode: false
emulator: goldfish_events.have-touch: false
emulator: goldfish_events.have-multitouch: false
emulator: control console listening on port 5554, ADB on port 5555
emulator: Adding boot property: 'net.wifi_mac_prefix' = '5554'
Not using any http proxy
emulator: Adding boot property: 'qemu.timezone' = 'Europe/Luxembourg'
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized

emulator: INFO: GrpcServices.cpp:288: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: emulator_window_fb_rotate

emulator: VERBOSE: MultiDisplay.cpp:695: config multidisplay with config.ini 0x0 0x0 0x0
emulator: VERBOSE: AdbInterface.cpp:386: Found: 3 adb executables
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:388: Adb: /Users/fleetback-ci/Library/Android/sdk/platform-tools/adb
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: VERBOSE: AdbInterface.cpp:410: Path:/Users/fleetback-ci/Library/Android/sdk/platform-tools/adb protocol version: 41
emulator: OpenGL Vendor=[Google (Apple)]
emulator: OpenGL Renderer=[Android Emulator OpenGL ES Translator (Apple M1)]
emulator: OpenGL Version=[OpenGL ES 3.0 (4.1 Metal - 71.5.9)]
emulator: INFO: ignore sdcard for arm at api level >= 30
checkValid: hw configs not eq
emulator: _hwFingerprint_connect: connect finger print listen is called

emulator: got message from guest system fingerprint HAL

emulator: INFO: boot completed
emulator: INFO: boot time 14294 ms
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: VERBOSE: MultiDisplay.cpp:189: getMultiDisplay 0x 0 y 0 w 1080 h 2280 dpi 0 flag 0 enable 1
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037

@drash-course
Copy link
Author

drash-course commented May 10, 2021

There is an update for the emulator. I'll try again with version 30.6.5. We had 30.5.6
Something seems broken on our install indeed.

@d4vidi
Copy link
Collaborator

d4vidi commented May 10, 2021

So looks like we're both charting new territories 😄
One more thing to try is the reset of the adb server, followed by various forced reconnection attempts:

$ adb
...
 start-server             ensure that there is a server running
 kill-server              kill the server if it is running
 reconnect                kick connection from host side to force reconnect
 reconnect device         kick connection from device side to force reconnect
 reconnect offline        reset offline/unauthorized devices to force reconnect

@drash-course
Copy link
Author

"/Users/fleetback-ci/Library/Android/sdk/emulator/emulator" -version still prints emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A) after the update to 30.6.5 with the SDK manager. I'll try with a clean install of Android.

@drash-course
Copy link
Author

@d4vidi
Copy link
Collaborator

d4vidi commented May 10, 2021

Kudos!!! Does this work with Detox, then?

@drash-course
Copy link
Author

drash-course commented May 10, 2021

Yes it works! Here are my steps if someone gets the same problem:

The google_apis image was not working for me, from the idea.logs it complained about a missing user.img file when creating the virtual device

  • Unzip and place the folder arm64-v8a in ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/
  • You can create a API 30 or API 31 AVD

On the detox side, maybe it's a regression but I had to run adb reverse. I'll make another ticket if I can reproduce.

@drash-course
Copy link
Author

I found this to download Android Studio 4.1.2.
https://www.techspot.com/downloads/downloadnow/6831/?evp=af65680fbea01bb42441cce8f4af7424&file=2

The page title is wrong though, it does download 4.1.2 and not 4.1.3.

@d4vidi
Copy link
Collaborator

d4vidi commented May 10, 2021

You can invoke port reversing through Detox as well.

As for Android Studio versions, I recommend to try to look up a Google archive.

@drash-course
Copy link
Author

drash-course commented May 10, 2021

Indeed, here is my environment.js for reference.

const {
    DetoxCircusEnvironment,
    SpecReporter,
    WorkerAssignReporter,
} = require('detox/runners/jest-circus');

const TWENTY_MINUTES = 20 * 60 * 1000;

class CustomDetoxEnvironment extends DetoxCircusEnvironment {
    constructor(config, context) {
        super(config, context);
        this.initTimeout = TWENTY_MINUTES;
        this.registerListeners({ SpecReporter, WorkerAssignReporter });
    }

    async initDetox() {
        const instance = await this.detox.init(undefined, { launchApp: false });
        await instance.device.reverseTcpPort(8081); // added this line
        await instance.device.launchApp({ permissions: { notifications: 'YES', camera: 'YES', microphone: 'YES', photos: 'YES' } });
        return instance;
    }
}

@drash-course
Copy link
Author

This may be off-topic. If you use gitlab-runner you may get this error when running your tests.

detox[77919] ERROR: [exec.js/EXEC_FAIL, #0] "applesimutils --list --byType "iPhone 11"" failed with code = 127, stdout and stderr:
152detox[77919] ERROR: [exec.js/EXEC_FAIL, #0] 
153detox[77919] ERROR: [exec.js/EXEC_FAIL, #0] /bin/sh: applesimutils: command not found
154detox[77919] ERROR: ChildProcessError: Command failed: applesimutils --list --byType "iPhone 11"
155/bin/sh: applesimutils: command not found
156 `applesimutils --list --byType "iPhone 11"` (exited with error code 127)

Note that applesimutils is properly installed with brew. It seems sh cannot follow the simlink. My simple fix is to copy the executable to /usr/local/bin/ like this.

sudo cp /opt/homebrew/Cellar/applesimutils/0.9.2/bin/applesimutils /usr/local/bin/

You should now uninstall it from brew to avoid having multiple applesimutils in your path.

brew uninstall applesimutils

@d4vidi
Copy link
Collaborator

d4vidi commented May 18, 2021

@drash-course I would advise against that. brew should set a symlink in /usr/local/bin for you. Perhaps trying to reinstall would work.

@mikehardy
Copy link
Contributor

Not sure if this will be useful for others or not, but as of today (July 15, 2021) a procedure that worked for me to get Detox tests working for react-native on an Apple M1 device were:

  • Get the current Arctic Fox Preview Apple Silicon build (https://developer.android.com/studio/archive - it is 2020.1.3 beta5 for me right now / https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.20/android-studio-2020.3.1.20-mac_arm.zip) - you can now run it as 'Android Studio Preview'
  • Use SDK Manager to install the emulator package
  • From Terminal go to $ANDROID_SDK_ROOT/emulator and run ./emulator make sure it updates itself with the emulator preview release etc (https://github.com/google/android-emulator-m1-preview/releases - 0.2 engine-only is what will be downloaded and unpacked). If you run ./emulator -version you should see 30.3.5.0 because the arm64 emulator is a custom build and overwrites the SDK Manager package. It will also show the exit code 255 could not find emulator binary executable error as well, which looks dire but may be ignored
  • Use AVD Manager to make a new AVD - I found if I used Android S / API31 preview networking was broken. API30 works though, both Play and Google APIs flavors. Boot it and test it, you should have a working emulator now
  • When you run Detox, it will give you a dire message about the exit code 255 mentioned above, but it will carry on :-). Then it hangs and times out because the adb reverse does need to be done manually for some reason. Either as above using Detox config or in Terminal with adb reverse tcp:8081 tcp:8081

I believe most of this is simply confirming the above info, but an important point for me was total emulator network failure on API31 while API30 worked in general but did need the manual reverse port mapping.

Cheers

@d4vidi
Copy link
Collaborator

d4vidi commented Jul 19, 2021

@mikehardy Thanks!!!
Worth mentioning: adb reverse is only needed when running in debug (dynamic bundle loading) mode.

@mikehardy
Copy link
Contributor

Oh yes! If you have the bundle packed up in the app (release mode) of course, it doesn't have to go over the port to fetch - good extra detail. This arm64 stuff is still pretty fiddly but at least most things are possible now. Side note: just last week google finally published a .xcframework with arm64 emulator slice for google sign in. Maps still doesn't work AFAIK. So, the whole ecosystem is still fractured after this architecture earthquake. But my detox tests ran! :-). Cheers

@d4vidi
Copy link
Collaborator

d4vidi commented Jul 19, 2021

whole ecosystem is still fractured after this architecture earthquake. But my detox tests ran! :-)

... which makes it all the more astounding. Kudos!

@sorodrigo
Copy link

Hey I'm struggling with this issue myself we get the following message:

detox[85761] INFO:  [test.js] deviceLaunchArgs="-partition-size 8000 -memory 6144 -no-snapshot -wipe-data -skin 800x1280" mocha --opts ./e2e/mocha.opts --configuration android.emu.debug --grep :ios: --invert --take-screenshots failing --use-custom-logger true ./e2e/specs/01_DE/03_DE_account_spec.js
detox[85763] INFO:  [DetoxServer.js] server listening on localhost:54419...
detox[85763] ERROR: [exec.js/EXEC_FAIL, #1] ""/Users/administrator/android-sdk/emulator/emulator" -version " failed with code = 255, stdout and stderr:
detox[85763] ERROR: [exec.js/EXEC_FAIL, #1] emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: ERROR: can't find the emulator executable.
detox[85763] ERROR: [exec.js/EXEC_FAIL, #1] 
detox[85763] ERROR: [EmulatorVersionResolver.js/EMU_BIN_VERSION_DETECT] Could not detect emulator binary version ChildProcessError: Command failed: "/Users/administrator/android-sdk/emulator/emulator" -version 
 `"/Users/administrator/android-sdk/emulator/emulator" -version ` (exited with error code 255)
    at callback (/Users/administrator/builds/K9TR58dn/0/developers/mobile-app/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (child_process.js:397:5)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:675:12) {
  code: 255,
  childProcess: {
    _forkChild: [Function: _forkChild],
    ChildProcess: [Function: ChildProcess],
    exec: [Function: exec],
    execFile: [Function: execFile],
    execFileSync: [Function: execFileSync],
    execSync: [Function: execSync],
    fork: [Function: fork],
    spawn: [Function: spawnWithSignal],
    spawnSync: [Function: spawnSync]
  },
  stdout: 'emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)\n' +
    "emulator: ERROR: can't find the emulator executable.\n" +
    '\n',
  stderr: ''
}
detox[85763] WARN:  [AVDValidator.js/AVD_VALIDATION] Emulator version detection failed (See previous logs)
detox[85763] ERROR: [exec.js/EXEC_FAIL, #2] ""/Users/administrator/android-sdk/emulator/emulator" -version " failed with code = 255, stdout and stderr:
detox[85763] ERROR: [exec.js/EXEC_FAIL, #2] emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: ERROR: can't find the emulator executable.
detox[85763] ERROR: [exec.js/EXEC_FAIL, #2] 
detox[85763] ERROR: [EmulatorVersionResolver.js/EMU_BIN_VERSION_DETECT] Could not detect emulator binary version ChildProcessError: Command failed: "/Users/administrator/android-sdk/emulator/emulator" -version 
 `"/Users/administrator/android-sdk/emulator/emulator" -version ` (exited with error code 255)
    at callback (/Users/administrator/builds/K9TR58dn/0/developers/mobile-app/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (child_process.js:397:5)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:675:12) {
  code: 255,
  childProcess: {
    _forkChild: [Function: _forkChild],
    ChildProcess: [Function: ChildProcess],
    exec: [Function: exec],
    execFile: [Function: execFile],
    execFileSync: [Function: execFileSync],
    execSync: [Function: execSync],
    fork: [Function: fork],
    spawn: [Function: spawnWithSignal],
    spawnSync: [Function: spawnSync]
  },
  stdout: 'emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)\n' +
    "emulator: ERROR: can't find the emulator executable.\n" +
    '\n',
  stderr: ''
}
detox[85763] WARN:  [EmulatorDriver.js/EMU_SKIN_CFG_PATCH] Failed to detect emulator version! (see previous logs)
This leaves Detox unable to tell if it should automatically apply this patch-fix: https://stackoverflow.com/a/47265664/453052, which seems to be needed in emulator versions < 28.
If you feel this is not needed, you can either ignore this message, or otherwise apply the patch manually.
waitForOnboarding button

but then most of the times it actually continues with the tests. The main issue I have is that it's a bit unreliable and also hangs for 2 minutes before continuing (I think it keeps retrying or something).

I think it would be good to reopen this issue until a stable solution is out there, that would make it easier for folks like me to find a place they can wait for better news.

@mikehardy
Copy link
Contributor

mikehardy commented Sep 2, 2021

I have found emulator startup to be unreliable for android emulators forever, intel macs as well. I use a kill / retry loop for my CI for this reason.

Once booted, this failure to detect emulator problem should only be warning + delay though, I had 100% reliable test execution even with that warning given I already had an emulator successfully booted.

@sorodrigo
Copy link

@mikehardy could you share with me your kill/retry loop code?

@mikehardy
Copy link
Contributor

Check react-native-firebase e2e workflow for android

@mikehardy
Copy link
Contributor

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 5, 2021

@mikehardy would you not rather let Detox spin up the emulators for ya?

@mikehardy
Copy link
Contributor

Too flaky in practice. The first restart hits maybe 10% of the time in github actions, second maybe 1% and so on. That's intolerable and I don't think detox has emu restart logic? If it does and I missed it though then sure

@sorodrigo
Copy link

I finally cracked it. I was starting the emulator but then detox was also trying to start it and sometimes this caused errors in connection to it. As a solution, I made sure the launch args are identical in both cases (detox and my own launch). The most important one was to add the port option so I ensure that both will try to create it in the same port, otherwise, I could end up with 2 instances (not very often).

@d4vidi I wonder if there's a way to skip the device launch altogether and just skip straight to the install? When trying to connect and failing it will spend 2 mins. If I could skip this step this would improve my tests considerably.

@mikehardy
Copy link
Contributor

In my experience if Detox detects the emulator/simulator is already up, it will not attempt to boot it, it just installs. So we boot separately (with flaky-restart-logic as above) and detox handles it. But locally (dev machines, where it's faster etc) detox boots things for me the first time in the morning according to the AVD name (android) or simulator profile (iOS) specified in detox config.

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 9, 2021

@sorodrigo, @mikehardy is right. I don't understand where this emulator boot-up race comes from but it sounds unhealthy. Technically, Detox enables you to preboot the emulator yourself. If it's an instance of the AVD specified in Detox's config of choice, then Detox should choose it for test execution.

@sorodrigo
Copy link

@d4vidi maybe then we just need to opt out of patching the emulator? Detox tries to patch it and it takes 2 min to fail and continue with the tests

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 14, 2021

@sorodrigo what's you execution environment? Strikes me odd that the emulator binary is not found.

@sorodrigo
Copy link

We're running the e2e in mac M1 machines using macOS Catalina. Detox version 17, because the latest version fails in M1 and also our testing code does not work well with the new version in other machines.

@mikehardy
Copy link
Contributor

I am only chiming in quickly to say this is an interesting coincidence! react-native-firebase, which is my M1 detox experience at the moment, is also stuck on Detox 17. I didn't think to mention it before, but anything I mentioned up above about it working on M1 was validated on Detox 17 and if 18 is broken I'm unaware of it and haven't tried yet

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 19, 2021

@mikehardy that's actually very important input. Obviously, we urge you'd at all times use the latest (and greatest) of Detox (i.e. version 18+).

@mikehardy
Copy link
Contributor

mikehardy commented Sep 19, 2021

Indeed - recognizing this is now veering off topic, our being on v17 vs v18 is totally on me/us over at react-native-firebase (though I do have great success on M1 with detox v17). I have moving to current stable as a todo for me and for whatever it's worth we just did a competitive analysis of the various test platforms for our next generation e2e harnesses (to be used in react-native-firebase, react-native-google-ads, notifee, react-native-mlkit, etc) and we're re-committing to Detox after a brief Cavy dalliance, so rest assured if v18 of Detox has an M1 problem I'll be back here, but hopefully with a PR :-). Cheers

@mikehardy
Copy link
Contributor

@sorodrigo not sure what parts of Detox you're using but I've updated to Detox v18 now and it works fine on M1, just not on iOS15 (a known issue #2895). I also tested Detox v18 with Android 12 and it appears fine (#2899). As far as I can tell, the only thing not working at the moment is ios15 (noted) and maybe a need for a manual adb reverse for bundler port 8081 - cheers

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 30, 2021

Indeed - recognizing this is now veering off topic, our being on v17 vs v18 is totally on me/us over at react-native-firebase (though I do have great success on M1 with detox v17). I have moving to current stable as a todo for me and for whatever it's worth we just did a competitive analysis of the various test platforms for our next generation e2e harnesses (to be used in react-native-firebase, react-native-google-ads, notifee, react-native-mlkit, etc) and we're re-committing to Detox after a brief Cavy dalliance, so rest assured if v18 of Detox has an M1 problem I'll be back here, but hopefully with a PR :-). Cheers

Thrilled to know! Looking forward to getting feedback on v18.

@musikobios
Copy link

For me as @mikehardy mentioned above, a adb reverse tcp:8081 tcp:8081 made the detox detect the react-native packager & run the tests. So the process is:

  • Run detox build command
  • Run react-native packager (npx react-native start)
  • Open the emulator & run adb reverse tcp:8081 tcp:8081
  • Run detox test command

@SkPratihar1
Copy link

""/Users/it062305/Library/Android/sdk/platform-tools/adb" -s emulator-11374 shell "ps | grep "com.eroev.app$""" failed with error = ChildProcessError: Command failed: "/Users/it062305/Library/Android/sdk/platform-tools/adb" -s emulator-11374 shell "ps | grep "com.eroev.app$""
"/Users/it062305/Library/Android/sdk/platform-tools/adb" -s emulator-11374 shell "ps | grep \"com\.eroev\.app$\"" (exited with error code 1) (code=1), stdout and stderr:

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

6 participants