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

Android 13 error with stay_on_while_plugged_in #4346

Closed
2 tasks done
bethany7 opened this issue Oct 11, 2023 · 3 comments
Closed
2 tasks done

Android 13 error with stay_on_while_plugged_in #4346

bethany7 opened this issue Oct 11, 2023 · 3 comments

Comments

@bethany7
Copy link

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

Environment

  • OS: Windows 10
  • scrcpy version: 2.1.1
  • installation method: Windows release
  • device model: OnePlus 8
  • Android version: 13

Describe the bug
Screen does not stay on while plugged in

C:\Users\batah\Downloads\scrcpy-win64-v2.1.1>scrcpy --stay-awake --max-size=1200 --power-off-on-close --no-power-on --turn-screen-off --disable-screensaver
scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)              10fba88d            device  IN2013
C:\Users\batah\Downloads\scrcpy-win64-v2.1.1\scrcpy-server... file pushed, 0 skipped. 52.4 MB/s (56995 bytes in 0.001s)
[server] INFO: Device: [OnePlus] OnePlus IN2013 (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:63)
        at com.genymobile.scrcpy.Server.lambda$startInitThread$2(Server.java:168)
        at com.genymobile.scrcpy.Server$$ExternalSyntheticLambda3.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: Texture: 544x1200
[server] INFO: Device screen turned off
@rom1v
Copy link
Collaborator

rom1v commented Oct 11, 2023

You might need to enable some ROM-specific option in your developer options to authorize adb to change settings.

@rom1v
Copy link
Collaborator

rom1v commented Oct 11, 2023

You might need to enable some ROM-specific option in your developer options to authorize adb to change settings.

See Genymobile/gnirehtet#5 (comment)

go to the Developer Settings on the phone and enable: Developer Options > Apps > Disable permission monitoring

@bethany7
Copy link
Author

You might need to enable some ROM-specific option in your developer options to authorize adb to change settings.

See Genymobile/gnirehtet#5 (comment)

go to the Developer Settings on the phone and enable: Developer Options > Apps > Disable permission monitoring

This fixed it. Thanks so much.

@rom1v rom1v closed this as completed Oct 11, 2023
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