Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.05k stars 10.65k forks source link

Blank screen when connected to Android ATD virtual device #4609

Open technoir42 opened 9 months ago

technoir42 commented 9 months ago

Environment

Describe the bug scrcpy shows a blank black screen when connected to ATD virtual device. When running a test, the screen flashes for fraction of a second, but the app doesn't seem to get rendered properly. Apps launched via adb shell manually aren't displayed either.

To reproduce, configure Gradle-managed device as follows:

android {
  testOptions {
    managedDevices {
      localDevices {
        pixel5 {
          device = "Pixel 5"
          apiLevel = 33
          systemImageSource = "google-atd"
        }
      }
    }
  }
}

Run instrumented tests on the Gradle-managed device as follows:

./gradlew pixel5DebugAndroidTest

Terminal output:

$ scrcpy -n -s emulator-5554 --no-audio --render-driver=software
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  emulator-5554                   device  Android_ATD_built_for_arm64
/opt/homebrew/Cellar/scrcpy/2.3.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 109.1 MB/s (66007 bytes in 0.001s)
[server] INFO: Device: [Google] google Android ATD built for arm64 (Android 13)
INFO: Renderer: software
INFO: Texture: 1080x2336

If I change to regular, non-ATD device, display output gets forwarded properly.

rom1v commented 9 months ago

On those ATD devices, can you capture using adb shell screenrecord /sdcard/file.mp4?

Jaz-z commented 8 months ago

Black screen issue for Murena 2 phone running e/OS; Please see

https://github.com/Genymobile/scrcpy/issues/3940

I included a description of problem in comments.