Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep server apk installed instead of pushing each time #1722

Open
psychowood opened this issue Aug 30, 2020 · 5 comments
Open

Keep server apk installed instead of pushing each time #1722

psychowood opened this issue Aug 30, 2020 · 5 comments

Comments

@psychowood
Copy link

Hi,
I tried searching for a similar feature request without success, hopefully it's not a duplicate

Is your feature request related to a problem? Please describe.
I start & stop scrcpy very frequently, and I was wondering if this could lead to useless flash memory degradation on my android device.
From my understanding, the file is pushed to /data/local/tmp/scrcpy-server.jar

Describe the solution you'd like
Option to persist the server instead of pushing and deleting it each time. Maybe comparing the shasum with something like

adb shell sha2sum /data/local/tmp/scrcpy-server.jar

before pushing.

Describe alternatives you've considered
Always pushing to a tmpfs to avoid writing on persistent storage.

@rom1v
Copy link
Collaborator

rom1v commented Sep 1, 2020

From my understanding, the file is pushed to /data/local/tmp/scrcpy-server.jar

Correct.

The reason why it is always push is that:

  • it's very fast
  • it avoids a mechanism to check if the installed version is up-to-date
  • checking would actually take as much time as just pushing it (and check+push takes more time)

I didn't thing about flash memory degradation though. But a priori, I would say that the write frequency is very low (it's not like a log file which could be written several times per second).

I'm not against an option to avoid it.

@psychowood
Copy link
Author

What about the alternative, pushing to ramfs/tmpfs? I don't know Android well enough, is there a standard/default path that can be used in alternative?

@rom1v
Copy link
Collaborator

rom1v commented Sep 1, 2020

$ adb shell mount | grep tmpfs
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0

shell do not have permission to write to these directories.

@rom1v
Copy link
Collaborator

rom1v commented Nov 11, 2020

#1880 (comment)

@rom1v
Copy link
Collaborator

rom1v commented Oct 2, 2022

Please check #3517.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants