DeviceFarmer / stf

Control and manage Android devices from your browser.
https://devicefarmer.github.io
Other
3.32k stars 479 forks source link

Android 12 did not show screen #346

Open coinhu1995 opened 2 years ago

coinhu1995 commented 2 years ago

What is the issue or idea you have? Pixel 3 (android 12) did not show screen image Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. device usb:35717120X product:blueline model:Pixel_3 device:blueline transport_id:6 Please provide the steps to reproduce the issue. Run stf and use device pixel 3 What is the expected behavior? Device screen is shown Do you see errors or warnings in the stf local output? If so, please paste them or the full log here.

2021-11-05T03:58:19.087Z INF/device 87158 [86TX00E6F] Preparing device
2021-11-05T03:58:19.330Z INF/api 87151 [*] Subscribing to permanent channel "*ALL"
2021-11-05T03:58:19.354Z INF/api 87151 [*] Listening on port 7106
2021-11-05T03:58:19.384Z INF/api 87151 [*] Sending output to "tcp://127.0.0.1:7113"
2021-11-05T03:58:19.385Z INF/api 87151 [*] Receiving input from "tcp://127.0.0.1:7111"
2021-11-05T03:58:19.385Z INF/api 87151 [*] Sending output to "tcp://127.0.0.1:7116"
2021-11-05T03:58:19.388Z INF/api 87151 [*] Receiving input from "tcp://127.0.0.1:7114"
2021-11-05T03:58:19.689Z INF/device:support:sub 87158 [86TX00E6F] Receiving input from "tcp://127.0.0.1:7114"
2021-11-05T03:58:19.690Z INF/db 87151 [*] Connecting to 127.0.0.1:28015
2021-11-05T03:58:19.691Z INF/device:support:sub 87158 [86TX00E6F] Subscribing to permanent channel "*ALL"
2021-11-05T03:58:19.761Z INF/device:support:properties 87158 [86TX00E6F] Loading properties
2021-11-05T03:58:19.806Z INF/device:support:sdk 87158 [86TX00E6F] Supports SDK 31
2021-11-05T03:58:19.807Z INF/device:support:abi 87158 [86TX00E6F] Supports ABIs arm64-v8a, armeabi-v7a, armeabi
2021-11-05T03:58:20.137Z INF/device:resources:minicap 87158 [86TX00E6F] Installing "/Users/nhu/workspace/source/stf/node_modules/@devicefarmer/minicap-prebuilt/prebuilt/noarch/minicap.apk" as "/data/local/tmp/minicap.apk"
2021-11-05T03:58:20.415Z INF/device:resources:service 87158 [86TX00E6F] Checking whether we need to install STFService
2021-11-05T03:58:20.530Z INF/device:resources:service 87158 [86TX00E6F] Running version check
2021-11-05T03:58:24.590Z INF/device:resources:service 87158 [86TX00E6F] STFService up to date
2021-11-05T03:58:24.594Z INF/device:plugins:service 87158 [86TX00E6F] Launching agent
2021-11-05T03:58:28.230Z INF/provider 87148 [*] Providing 0 of 1 device(s); waiting for "86TX00E6F"
2021-11-05T03:58:28.285Z INF/device:plugins:service 87158 [86TX00E6F] Agent says: "Starting minitouch agent"
2021-11-05T03:58:28.301Z INF/device:plugins:service 87158 [86TX00E6F] Agent says: "Listening on @stfagent"
2021-11-05T03:58:28.344Z INF/device:plugins:service 87158 [86TX00E6F] Launching service
2021-11-05T03:58:28.345Z INF/device:plugins:service 87158 [86TX00E6F] using 'start-foreground-service' command for API 31
2021-11-05T03:58:28.347Z INF/device:plugins:service 87158 [86TX00E6F] Agent says: "InputClient started"
2021-11-05T03:58:28.431Z INF/device:plugins:display 87158 [86TX00E6F] Reading display info
2021-11-05T03:58:28.441Z INF/device:plugins:phone 87158 [86TX00E6F] Fetching phone info
2021-11-05T03:58:28.449Z INF/device:plugins:identity 87158 [86TX00E6F] Solving identity
2021-11-05T03:58:28.454Z INF/device:plugins:solo 87158 [86TX00E6F] Subscribing to permanent channel "9Kh408vt62sjtRYHmSeY5EyQB9s="
2021-11-05T03:58:28.456Z INF/device:plugins:screen:stream 87158 [86TX00E6F] ScreenGrabber option set to minicap-bin
2021-11-05T03:58:28.456Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Starting WebSocket server on port 7400
2021-11-05T03:58:28.462Z INF/device:plugins:screen:stream 87158 [86TX00E6F] creating FrameProducer: minicap-bin
2021-11-05T03:58:28.793Z INF/device:resources:minitouch 87158 [86TX00E6F] Installing "/Users/nhu/workspace/source/stf/node_modules/@devicefarmer/minitouch-prebuilt/prebuilt/arm64-v8a/bin/minitouch" as "/data/local/tmp/minitouch"
2021-11-05T03:58:28.847Z WRN/device:plugins:data 87158 [86TX00E6F] Unable to find device data { serial: '86TX00E6F',
  platform: 'Android',
  manufacturer: 'GOOGLE',
  operator: null,
  model: 'Pixel 3',
  version: '12',
  abi: 'arm64-v8a',
  sdk: '31',
  product: 'blueline',
  cpuPlatform: 'sdm845',
  openGLESVersion: '3.2',
  marketName: 'Pixel 3',
  display: 
   { id: 0,
     width: 1080,
     height: 2160,
     xdpi: 442.45098876953125,
     ydpi: 442.45098876953125,
     fps: 60.000003814697266,
     density: 2.75,
     rotation: 0,
     secure: true,
     size: 5.4581263846100265,
     url: 'ws://localhost:7400' },
  phone: {} }
2021-11-05T03:58:28.852Z INF/device:plugins:touch 87158 [86TX00E6F] Touch origin is top left
2021-11-05T03:58:28.853Z INF/device:plugins:touch 87158 [86TX00E6F] Requesting touch consumer to start
2021-11-05T03:58:28.854Z INF/device:plugins:touch 87158 [86TX00E6F] Launching touch service
2021-11-05T03:58:28.864Z INF/device:plugins:touch 87158 [86TX00E6F] Connecting to minitouch service
2021-11-05T03:58:28.889Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "open: Permission denied"
2021-11-05T03:58:28.889Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Unable to open device /dev/input/event3 for inspectionopen: Permission denied"
2021-11-05T03:58:28.890Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Unable to open device /dev/input/event2 for inspectionopen: Permission denied"
2021-11-05T03:58:28.890Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Unable to open device /dev/input/mice for inspectionopen: Permission denied"
2021-11-05T03:58:28.890Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Unable to open device /dev/input/event0 for inspectionopen: Permission denied"
2021-11-05T03:58:28.892Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Unable to open device /dev/input/event1 for inspectionUnable to find a suitable touch device"
2021-11-05T03:58:28.892Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "using Android InputManager"
2021-11-05T03:58:28.977Z INF/device:plugins:touch 87158 [86TX00E6F] Reading minitouch banner
2021-11-05T03:58:28.979Z INF/device:plugins:touch 87158 [86TX00E6F] minitouch says: "Connection established"
2021-11-05T03:58:28.987Z INF/device:plugins:vnc 87158 [86TX00E6F] Starting VNC server on port 7402
2021-11-05T03:58:28.991Z INF/device:plugins:browser 87158 [86TX00E6F] Loading browser list
2021-11-05T03:58:29.036Z INF/device:plugins:browser 87158 [86TX00E6F] Updating browser list
2021-11-05T03:58:29.039Z INF/device:plugins:mute 87158 [86TX00E6F] Will not mute master volume
2021-11-05T03:58:29.394Z INF/device:resources:minirev 87158 [86TX00E6F] Installing "/Users/nhu/workspace/source/stf/vendor/minirev/arm64-v8a/minirev" as "/data/local/tmp/minirev"
2021-11-05T03:58:29.457Z INF/device:plugins:forward 87158 [86TX00E6F] Launching reverse port forwarding service
2021-11-05T03:58:29.472Z INF/device:plugins:forward 87158 [86TX00E6F] Connecting to reverse port forwarding service
2021-11-05T03:58:29.685Z INF/device 87158 [86TX00E6F] Fully operational
2021-11-05T03:58:38.240Z INF/provider 87148 [*] Providing all 1 device(s)
2021-11-05T03:58:45.944Z INF/device:plugins:group 87158 [86TX00E6F] Subscribing to group channel "BjOJlYhmSkGo3Qt1NSiW1g=="
2021-11-05T03:58:46.000Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Setting frame producer projection to 778x778
2021-11-05T03:58:46.000Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Requesting frame producer to start
2021-11-05T03:58:46.001Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Launching screen service minicap-bin
2021-11-05T03:58:46.001Z ERR/device:resources:minicap 87158 [86TX00E6F] Missing resources/unknown minicap grabber: minicap-bin
2021-11-05T03:58:46.001Z INF/device:resources:minicap 87158 [86TX00E6F] undefined
2021-11-05T03:58:46.045Z INF/device:plugins:screen:stream 87158 [86TX00E6F] minicap says: "/system/bin/sh: undefined: inaccessible or not found"
2021-11-05T03:58:46.045Z WRN/device:plugins:screen:stream 87158 [86TX00E6F] Shell keeping minicap running ended unexpectedly
2021-11-05T03:58:46.114Z INF/device:plugins:connect 87158 [86TX00E6F] Listening on port 7401
2021-11-05T03:58:46.115Z IMP/device:plugins:connect 87158 [86TX00E6F] Remote Connect Started for device "86TX00E6F" at "localhost:7401"
2021-11-05T03:58:48.039Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Disconnecting from minicap service
2021-11-05T03:58:48.043Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Stopping minicap service
2021-11-05T03:58:48.046Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Launching screen service minicap-apk
2021-11-05T03:58:48.047Z INF/device:resources:minicap 87158 [86TX00E6F] CLASSPATH=/data/local/tmp/minicap.apk app_process /system/bin io.devicefarmer.minicap.Main -S -Q 80 -P 1080x2160@778x778/0
2021-11-05T03:58:50.075Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Disconnecting from minicap service
2021-11-05T03:58:50.077Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Stopping minicap service
2021-11-05T03:58:50.080Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Ending minicap I/O as a last resort
2021-11-05T03:58:59.835Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Requesting frame producer to stop
2021-11-05T03:59:10.725Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Keeping 778x778 as current frame producer projection
2021-11-05T03:59:10.727Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Requesting frame producer to start
2021-11-05T03:59:10.737Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Launching screen service minicap-apk
2021-11-05T03:59:10.740Z INF/device:resources:minicap 87158 [86TX00E6F] CLASSPATH=/data/local/tmp/minicap.apk app_process /system/bin io.devicefarmer.minicap.Main -S -Q 80 -P 1080x2160@778x778/0
2021-11-05T03:59:11.752Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Requesting frame producer to stop
2021-11-05T03:59:12.775Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Disconnecting from minicap service
2021-11-05T03:59:12.777Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Stopping minicap service
2021-11-05T03:59:12.780Z INF/device:plugins:screen:stream 87158 [86TX00E6F] Ending minicap I/O as a last resort

Please run stf doctor and paste the output here.

2021-11-05T04:01:36.058Z INF/cli:doctor 87197 [*] OS Arch: x64
2021-11-05T04:01:36.060Z INF/cli:doctor 87197 [*] OS Platform: darwin
2021-11-05T04:01:36.060Z INF/cli:doctor 87197 [*] OS Platform: 20.5.0
2021-11-05T04:01:36.061Z INF/cli:doctor 87197 [*] Using Node 8.16.2
2021-11-05T04:01:36.092Z INF/cli:doctor 87197 [*] Using ZeroMQ 4.3.4
2021-11-05T04:01:36.121Z INF/cli:doctor 87197 [*] Using ADB 1.0.41
2021-11-05T04:01:36.126Z INF/cli:doctor 87197 [*] Using RethinkDB 2.4.1
2021-11-05T04:01:36.133Z INF/cli:doctor 87197 [*] Using GraphicsMagick 1.3.36
2021-11-05T04:01:37.470Z INF/cli:doctor 87197 [*] Using ProtoBuf 3.17.3
igexogen commented 2 years ago

I have the same issue and only on pixel 3 (pixel 3a/3xl/4 works fine). temporarily workaround is factory reset device. but after a while the problem appears again.

csdaa commented 2 years ago

I have the same issue on Pixel 4 Android S

pcrepieux commented 2 years ago

There are 2 minicap implementations that stf can use: a binary and an apk. By default stf uses the binary which is the "legacy" one. Starting with Android 10, an apk has been experimented (because it is expected to be more stable API wise and easier to maintain). If the default one doesn't work, stf fallback to de second one. Could you try by setting minicap-apk as the default one to see if this could be related to a timeout coming from the fallback being a bit long ? You can easily try it by setting a environment variable like this: SCREEN_GRABBER=minicap-apk bin/stf local (or whatever suits your environment)

see commit https://github.com/DeviceFarmer/stf/commit/bb1c20d1f7bc662fc155f84b0af3374f7c7aeabd for more details It's been done like this in order not to break minicap at the early stage but maybe we coud now reverse the order.

Note also that the apk version is a bit longer to start than the binary. On my side I never experienced this issue but depending on your feedback there is maybe a couple of things we could try.

csdaa commented 2 years ago

Thank you for your answer. Will "apk" be open source?

pcrepieux commented 2 years ago

@csdaa it is open source since day one 👉 https://github.com/DeviceFarmer/minicap/tree/master/experimental

ii958 commented 1 year ago

change your minicap to support SDK 31

mhkarimi1383 commented 1 year ago

There are 2 minicap implementations that stf can use: a binary and an apk. By default stf uses the binary which is the "legacy" one. Starting with Android 10, an apk has been experimented (because it is expected to be more stable API wise and easier to maintain). If the default one doesn't work, stf fallback to de second one. Could you try by setting minicap-apk as the default one to see if this could be related to a timeout coming from the fallback being a bit long ? You can easily try it by setting a environment variable like this: SCREEN_GRABBER=minicap-apk bin/stf local (or whatever suits your environment)

see commit bb1c20d for more details It's been done like this in order not to break minicap at the early stage but maybe we coud now reverse the order.

Note also that the apk version is a bit longer to start than the binary. On my side I never experienced this issue but depending on your feedback there is maybe a couple of things we could try.

I have added this environment to my setup (Docker Compose) but Problem persist, Removing data did not worked

Also in logs I can see that minicap apk is installed

@pcrepieux I did some checks and Samsung is working but Nokia (I think the android one) is not working (Tested on android 12) Also on Xiaomi there is support for touch and other controls (Tested on android 13 [do not forget to turn on security option])

mhkarimi1383 commented 1 year ago

Oh, Xiaomi on android 12 is also working

willisfeng commented 1 year ago

minicap not support SDK 32? Pixel 3a xl (android 12) hava the same issue