Genymobile / Genymobile/scrcpy

Scrcpy v1.17 fails to push files to device

Open
#2,011 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [OK] I have read the [FAQ](https://github.com/Genymobile/scrcpy/blob/master/FAQ.md).
- [OK] I have searched in existing [issues](https://github.com/Genymobile/scrcpy/issues).
- _Note: I did do a quick research and used some different criteria such as file-push, adb-push but none were related to failing to push a file to a device. My apologies if a thread for this already exists _**for the current scrcpy version**_, but I couldn't find any myself._

**Environment**
- OS: Debian (Linux Mint 19.1 64-bit)
- scrcpy version: 1.17
- installation method: Manual build
- device model: LG K11 (2017)
- Android version: Android 7.0

**Describe the bug**
Pushing files to my device used to work before. I used to use the Snap version, but after 1.16, I removed the Snap one and decided to manually build scrcpy (along with prebuilt server).
While it does launch without complaining, attempting to push a file to a device fails. Terminal output:
```
$ scrcpy --max-size 1024 -S --push-target /storage/3939-6263/Downloads/scrcpy/
INFO: scrcpy 1.17
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 5.3 MB/s (34930 bytes in 0.006s)
[server] INFO: Device: LGE LG-M250 (Android 7.0)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 20.0.8
INFO: Trilinear filtering enabled
INFO: Initial texture: 576x1024
[server] INFO: Device screen turned off
INFO: Request to push /home/rodolfo/Videos/failarmy/meancat.mp4
INFO: Pushing /home/rodolfo/Videos/failarmy/meancat.mp4...
adb: error: failed to copy '/home/rodolfo/Videos/failarmy/meancat.mp4' to '/storage/3939-6263/Downloads/scrcpy/':
remote secure_mkdirs failed: Permission denied
/home/rodolfo/Videos/failarmy/meancat.mp4: 0 files pushed. 568.5 MB/s (1086744 bytes in 0.002s)
ERROR: "adb push" returned with value 1
ERROR: Failed to push /home/rodolfo/Videos/failarmy/meancat.mp4 to /storage/3939-6263/Downloads/scrcpy/
```

I find it interesting that log associates that error with "adb push", which returned 1.
I thought adb push would only return 1 in case my device isn't found. But `adb devices` returns:
```
List of devices attached
LGM250SK99EQFEF6NZ device
```
So I'm out of ideas. Any help is appreciated.
Also, let me know if you need some other info, logs or outputs.

Regards.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with scrcpy 1.17 using --push-target and the reported adb push command on the listed Android device setup. Trace how the push target is passed to adb and compare the permission error with a destination where adb push succeeds; done means file pushing works without the remote secure_mkdirs failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.