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

--stay-awake erroring out on console #4021

Closed
2 tasks done
EPinci opened this issue May 21, 2023 · 4 comments
Closed
2 tasks done

--stay-awake erroring out on console #4021

EPinci opened this issue May 21, 2023 · 4 comments

Comments

@EPinci
Copy link

EPinci commented May 21, 2023

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Windows
  • scrcpy version: 2.0
  • installation method: Windows release
  • device model: Oneplus KB2003
  • Android version: 13

Describe the bug
The --stay-awake options errors out.

[server] INFO: Device: OnePlus KB2003 (Android 13)
[server] ERROR: Could not change "stay_on_while_plugged_in"
com.genymobile.scrcpy.SettingsException: Could not access settings: put global stay_on_while_plugged_in 7
        at com.genymobile.scrcpy.Settings.execSettingsPut(Settings.java:24)
        at com.genymobile.scrcpy.Settings.putValue(Settings.java:59)
        at com.genymobile.scrcpy.Settings.getAndPutValue(Settings.java:78)
        at com.genymobile.scrcpy.Server.initAndCleanUp(Server.java:36)
        at com.genymobile.scrcpy.Server.lambda$startInitThread$1(Server.java:159)
        at com.genymobile.scrcpy.Server$$ExternalSyntheticLambda2.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: java.io.IOException: Command [settings, put, global, stay_on_while_plugged_in, 7] returned with value 255
        at com.genymobile.scrcpy.Command.exec(Command.java:16)
        at com.genymobile.scrcpy.Settings.execSettingsPut(Settings.java:22)
        ... 6 more
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400

Please do not post screenshots of your terminal, just post the content as text instead.

@rom1v
Copy link
Collaborator

rom1v commented May 21, 2023

Try: Developer Options > Apps > Disable permission monitoring

Refs Genymobile/gnirehtet#5 (comment)

@rom1v
Copy link
Collaborator

rom1v commented May 21, 2023

What is the result of:

adb shell settings put global stay_on_while_plugged_in 7

?

(EDIT: missing settings)

@EPinci
Copy link
Author

EPinci commented May 21, 2023

Result is:

D:\>adb shell put global stay_on_while_plugged_in 7
/system/bin/sh: put: inaccessible or not found

Enabling "Disable permission monitoring" effectively makes it work.
Wonder if there's a way to allow this only for scrcpy instead of everything.

@rom1v
Copy link
Collaborator

rom1v commented May 22, 2023

Wonder if there's a way to allow this only for scrcpy instead of everything

Nope. This option does not exist on Android (AOSP), it's a vendor addition.

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