scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Avoid rewrites in tmp

Open lollita opened this issue 4 years ago • 13 comments

If I have understood correctly, scrcpy, every time it runs, it writes scrcpy-server.odex and scrcpy-server.vdex in /data/local/tmp. Do it is possible to avoid all these rewrites, and keep the file by overwriting it if not exist or there is a new one?

lollita avatar Nov 03 '20 17:11 lollita

See #1722.

Why is it a problem for you?

rom1v avatar Nov 03 '20 17:11 rom1v

I think it's unnecessary wear and tear on the memory card if avoidable. I subscribe #1722.

lollita avatar Nov 03 '20 17:11 lollita

Maybe make an apk package for the scrcpy-server?

Biswa96 avatar Nov 03 '20 17:11 Biswa96

I use chmod -w /data/local/tmp/oat/arm64/scrcpy-server.* Until the new version.

lollita avatar Nov 03 '20 17:11 lollita

If user has concern about this, the best way is to create an apk and install it. However, it may need to do something to make server as apk. In short time, maybe we can remain the server in device and calculate the checksum to ensure the server in device is expected.

npes87184 avatar Nov 04 '20 05:11 npes87184

For information, I started to work on a new option (probably --install) which would install the server (if the same version is not already installed) instead of pushing it (the same way I do for gnirehtet). As a side effect, this will solve this issue.

The goal is to install a real Android app. This will pave the way to:

  • provide an IME (to inject non-ASCII text)
  • forward audio (a proper integration of what sndcpy does)
  • optionally mirror camera instead of the screen (which requires a user authorization from an app)

rom1v avatar Nov 11 '20 20:11 rom1v

For information, I started to work on a new option (probably --install) which would install the server (if the same version is not already installed) instead of pushing it (the same way I do for gnirehtet). As a side effect, this will solve this issue.

The goal is to install a real Android app. This will pave the way to:

  • provide an IME (to inject non-ASCII text)
  • forward audio (a proper integration of what sndcpy does)
  • optionally mirror camera instead of the screen (which requires a user authorization from an app)

I am excited about this, things like #1484 can also be solved by provding apk. For example, we can add a notification or toast directly on phone.

npes87184 avatar Nov 14 '20 02:11 npes87184

@rom1v how about progress of scrcpy's IME?

quyleanh avatar Feb 22 '21 11:02 quyleanh

Unfortunately, no. For now, I'm working on #40 to add asynchronous swscale, and I'm doing more refactors (so that in the end I will be able to split the core from the UI).

Also related, as an alternative, maybe #2130 could allow proper text injection (I don't know).

rom1v avatar Feb 22 '21 17:02 rom1v

Thank you. I hope the IME can be implemented soon.

quyleanh avatar Feb 23 '21 02:02 quyleanh

ls: /data/local/tmp/oat/arm64/scrcpy-server.* : No such file or directory ls: /data/local/tmp/scrcpy-server.*: No such file or directory

lollita avatar Aug 21 '21 12:08 lollita

Please check #3517.

rom1v avatar Oct 02 '22 16:10 rom1v

I replaced "scrcpy-server" with a 0 size file. It seems that it does not write the file but I get "scrcpy-server: 1 file pushed, 0 skipped." Why?

lollita avatar Mar 12 '23 07:03 lollita