-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Have phone screen off while mirroring on computer #175
Comments
👍 Disable phone screen will be a nice feature . |
Yes, that would be great. But I have no technical solution. See reddit comment. |
Ok thanks for the response. Anyway of having the screen switch to stay awake when using this? Currently every time I use this I have to go into developer options and switch on stay awake while charging. I don't really want it staying awake if I am charging my phone overnight while not using this so I have to go back in every time after using scrcpy and switch stay awake off. If possible it would be a nice convenience. Thanks for this, I've been using this for a few days now at work. Since Oreo came out Sidesync hasn't been working so this was a great find. thumbs up |
Currently, no. It's probably possible to wrap scrcpy with a script that enable/disable "keep screen on". (Just for info, a right click switches the screen on.) |
Ok thanks again for the response. Ya I was using the right click to turn on but I have to unlock the phone everytime so it would be better to have the screen awake all the time in my case. I use my phone a lot during the day to contact my drivers (I'm in dispatch) so unlocking the phone everytime gets clunky. Thanks for whatever you can do. |
Just an idea...
If the server has enough privileges as shell, and has a chance to detect
disconnection and do something before dying, it could set the global
setting key "stay_on_while_plugged_in" to value 7 upon starting, and reset
it just before dying? Same for brightness setting (if a global one exists?).
That would "automate" the described behavior...
Le lun. 18 juin 2018 à 17:56, WrathX <notifications@github.com> a écrit :
… Ok thanks again for the response. Ya I was using the right click to turn
on but I have to unlock the phone everytime so it would be better to have
the screen awake all the time in my case. I use my phone a lot during the
day to contact my drivers (I'm in dispatch) so unlocking the phone
everytime gets clunky. Thanks for whatever you can do.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#175 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2kb9TKazS5UQ_km4k3zW145_DxbidYks5t982-gaJpZM4Up18Q>
.
|
bypassing the lock screen, that would be quite the exploit in the android os (unless u purposely put it there). |
What's the version of downloaded scrcpy? If it's below the current then download the actual version and run on terminal the command scrcpy -h, there's a session of shortcuts in the end. To turn on/off screen of phone, type Ctrl + P. |
I was able to do this with a script combined with Tasker and AutoRemote installed on the phone. Tasker sets the display timeout. I also have it set screen brightness to minimum. I would like to turn off the screen on the phone but can't do it without blanking scrcpy as well. |
What did you use for the trigger? I'm looking to do something similar. |
Oh, I investigated a bit tonight, in fact it's quite easy: IBinder display = SurfaceControl I have a working PoC. The power button reenables the screen (which is good for the physical button, but is also an issue with the simulated power button on scrcpy starting and on right-click/Ctrl+P, e.g. when the screen goes black after timeout, a right-click also reenable the device screen). I will probably work on this soon if I find some time. |
If you are interested, here is my quick test: |
I am also interested when the screen goes off, in Vysor there was implemented when this happened and I click on any key it will turn on the screen. Will be nice to have this feature. |
If the screen is off, a right-click turns it on. |
It works, thanks! |
+1 - have tried the test and it works just about perfectly (Galaxy Note 9) - only thing I've found is as stated above - if screen turns off, when it comes back on, phone display also does too. Would also love to see if it's possible to include a --no-screen flag to choose at launch if you want screen off or not. |
Add two shortcuts: - Ctrl+o to turn the device screen off while mirroring - Ctrl+Shift+o to turn it back on On power on (either via the POWER key or BACK while screen is off), both the device screen and the mirror are turned on. <#175>
Implemented on Press
I decided not to add such an option, because as soon as the display is off (timeout or explicit power off), we need to "power on", causing both the device screen and the mirror to be turned on. Thus, the command line option would not be "persistent", and this would be confusing. |
I have tested this feature. There is a problem I find, after switch off and on sometimes, the device screen cannot be turned on. I am using HTC One M8 with android 6 and OnePlus 6 with android 9 for testing. |
@npes87184 Anything in Does it switch on with the power button? (if both the device screen and the mirror are black, you need to POWER ON) |
Maybe |
The problem is device screen is black and the scrcpy works. In this time I cannot turn on screen by There are some logs here: It seems the first time failed, it will show:
After it, when I try to turn it off:
And try turn on again:
The log is flowing, I try my best to get related log... If the log does not meet the requirement, please contact me, I will reproduce it again and get more detail. Thanks. |
Is there a release to test this out? |
@npes87184 I have no idea about the cause, and I cannot reproduce :( |
And while keeping the screen turned off, we can use this batch file to prevent the OS from sleeping @echo off
setlocal
set APP=scrcpy-noconsole.exe
set APP_DIR=C:\scrcpy
:scrcpy
pushd %APP_DIR%
start %APP% -b 16M -S
popd
rem generate mouse event while scrcpy is running
:loop
adb shell input keyevent mouse
timeout /t 5 /nobreak > NUL
tasklist /FI "IMAGENAME eq %APP%" 2>NUL | find /I /N "%APP%" > NUL
if "%ERRORLEVEL%"=="0" goto loop
:end
endlocal |
I just reactivated the shortcut ( @npes87184 can you still reproduce the issue? |
I would test it after 6/3. |
My screen seems to get permanently dimmed if I use Ctrl + Shift + O (turning it off and on will make it remain dimmed, only can fix with restart). |
I tested it on my samsung galaxy note10+. It worked! |
when i press 'ctrl + o' then this error through 👇 |
Which scrcpy version? Which Android version? |
Scrcpy v1.9 and Android 10. plz help 🙏 |
That's very old. Just use the latest version. |
which one ?? |
'ctrl + o' does not work in scrcpy (v1.16) |
Since v1.15, the shortcuts are bound to Alt by default, so it's Alt+o. |
Thankyou 😊😊 'alt + o' work in v1.16. but how i can screen turned on. |
Please read the doc: https://github.com/Genymobile/scrcpy#shortcuts |
Thank you so much 😊😊 |
sir where can i find it 32bit version. |
You can find 32bit version in release page. |
I'm sorry, but maybe it's not safe. Here is the Virustotal report. |
@repositories-hub #1102 |
@rom1v ThankYou 🙏 😊 |
This feature stopped working on Android 14 |
|
It would be nice to have the screen mirroring on like it does but have the phone screen off, only showing on the computer. Would need to be able have the screen awake all the time while plugged in as well. Great job on this so far, just got it recently and it's very responsive. I use it at work all day. Thanks.
The text was updated successfully, but these errors were encountered: