scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Android10 mobile phone cannot cast screen

Open zhangweildlh opened this issue 1 year ago • 5 comments

  • [ OK ] I have read the FAQ.
  • [ OK ] I have searched in existing issues.

Environment

  • OS: Windows11 Professional x64, antivirus software turned off
  • scrcpy version: scrcpy-win64-v2.0
  • installation method: Windows release
  • device model: Xiaomi CC9e in China
  • Android version: Android 10

Describe the bug

  1. Scrcpy location: "D:\scrcpy-win64-v2.0"

  2. ADB debugging enabled

D:\scrcpy-win64-v2.0>adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
3ed52b1d0f6b    device
  1. USB debugging authorized

  2. ADB connection is normal and only one mobile phone is connected

  3. 【Scrcpy prompt】

D:\scrcpy-win64-v2.0>scrcpy
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
adb: error: stat failed when trying to push to /data/local/tmp/scrcpy-server.jar: Permission denied
ERROR: "adb push" returned with value 1
ERROR: Server connection failed
  1. I try to copy "scrcpy server" to "/data/local/tmp/scrcpy server. jar" and chmod775

Still failed to cast the screen!!! 1 2 3 4

zhangweildlh avatar Mar 12 '23 10:03 zhangweildlh

Try manually:

adb push scrcpy-server /data/local/tmp/scrcpy-server.jar

What is the result?

What is the output of:

adb shell ls -l /data/local/tmp/

rom1v avatar Mar 12 '23 10:03 rom1v

你使用root复制旧版本的server,导致2.0server校验不通过,scrcpy尝试复制新版本server但是adb不能操作用户组为root的文件,你要删掉旧版本并且避免用root权限操作文件

WQY916 avatar Mar 12 '23 10:03 WQY916

Try manually: adb push scrcpy-server /data/local/tmp/scrcpy-server.jar Result:

scrcpy-server: 1 file pushed, 0 skipped. 114.2 MB/s (52867 bytes in 0.000s)
adb: error: failed to copy 'scrcpy-server' to '/data/local/tmp/scrcpy-server.jar': remote couldn't create file: Permission denied

Try manually: adb shell ls -l /data/local/tmp/ Result:

ls: /data/local/tmp/: Permission denied

Try manually: adb shell su -c "ls -l /data/local/tmp/" Result:

total 0

Try manually: adb push scrcpy-server /sdcard/scrcpy-server.jar Result:

scrcpy-server: 1 file pushed, 0 skipped. 123.2 MB/s (52867 bytes in 0.000s)

Try manually: adb shell su -c "mv -f /sdcard/scrcpy-server.jar /data/local/tmp/scrcpy-server.jar" Try manually: adb shell su -c "ls -lA /data/local/tmp/scrcpy-server.jar" Result:

-rw-rw---- 1 root sdcard_rw 52867 2023-03-12 09:13 /data/local/tmp/scrcpy-server.jar

Try manually: adb shell su -c "chmod 775 /data/local/tmp/scrcpy-server.jar" Try manually: adb shell su -c "ls -lA /data/local/tmp/scrcpy-server.jar" Result:

-rwxrwxr-x 1 root sdcard_rw 52867 2023-03-12 09:13 /data/local/tmp/scrcpy-server.jar

1

2

zhangweildlh avatar Mar 12 '23 11:03 zhangweildlh

Try manually: adb root

adbd cannot run as root in production builds

zhangweildlh avatar Mar 12 '23 11:03 zhangweildlh

root操作文件是大忌

WQY916 avatar Mar 12 '23 12:03 WQY916