Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.29k stars 10.81k forks source link

--keep-awake doesn't work on Xiaomi Mi 11 Lite 5G NE #5421

Open mon0theist opened 1 month ago

mon0theist commented 1 month ago

Please read the prerequisites to run scrcpy.

Also read the FAQ and check if your issue already exists.

Environment

Describe the bug

A clear and concise description of what the bug is.

The --keep-awake flag doesn't appear to do anything, screen still eventually turns off and locks. Running in USB Debugging mode, not OTG mode. Have not tried OTG mode yet.

On errors, please provide the output of the console (and adb logcat if relevant).

No error messages

Please paste terminal output in a code block. Please do not post screenshots of your terminal, just post the content as text instead.

PS C:\Users\User> scrcpy --no-audio --stay-awake
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  a17b365                         device  2109119DG
C:\Users\User\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 13.8 MB/s (71200 bytes in 0.005s)
[server] INFO: Device: [Xiaomi] Xiaomi 2109119DG (Android 14)
INFO: Renderer: direct3d
INFO: Texture: 1080x2400
rom1v commented 1 month ago

--stay-awake has the same effect as:

adb shell settings put global stay_on_while_plugged_in 7

https://developer.android.com/reference/android/provider/Settings.Global#STAY_ON_WHILE_PLUGGED_IN

This should prevent the display to turn off after some delay if it is plugged in.

Check the value of:

adb shell settings get global stay_on_while_plugged_in

If setting this value does not change the behavior, this is a bug in your device system.

How is your device plugged? Over USB? On a dock?