 Today, we're gonna be looking at keeping the screen on on your Android device. So real quick one of the times I do what I'm about to show you is with SCR CPY. It should be in your repositories for your Linux distribution, at least it's in the Debian repositories. I'll go ahead and run that and the only thing you need to do on your phone you know is hook up USB and make sure that ADB is enabled and it will push over some program and then start up and now I can interact with my device right here on my computer. I can record it and I can type things copy and paste and it's great except for if I'm doing that, but I'm not interacting with the phone I'm just viewing it after a while the screen will time out and it'll turn off And then I've got to reach over press the power button and lock it all that stuff So how can we keep our screen from falling asleep? You can go into the settings on the device and change the time of the sleep time out You can also set it to always have the screen on when it's hooked to USB which I believe you can turn on settings But if you're already ADB'd in so let me go ahead and ADB shell here I can run this command and it's SVC power stay on USB and that will set the device to always stay on while it's hooked to USB now You can also turn it off with the same command, but instead of saying USB you just set it to false So SVC power stay on false and that will disable what we just enabled now I don't use that because I don't necessarily want the screen on all the time every time I plug it into USB I go to the night it go to bed at night. I plug it in I don't want the screen to turn on and stay on so how can I get to stay on while I'm using the screen sharing here Without doing that. Well, I'm gonna show you something a little hacky if we do while true. Let's shrink this down So you can feel it better anyway, I'll make it bigger again We'll just go through it so while true so we're doing a while loop do this and again This is in the ADB shell so on the device input key vent mouse And then we're gonna say sleep and we're gonna sleep for five seconds done What this does is it basically is telling the the phone to well see the screen just went off Let me turn it back on that's the issue that I'm trying to avoid right there I'll run this and what it's doing is it's doing this loop where basically it's it's Moving the mouse or pressing the mouse. It's doing a mouse events So it thinks that you're touching the screen and it does that every five seconds or wherever we set the loop for It's kind of a hacky way to do it But when I'm doing the screen recordings or doing something where I'm interacting on my phone here I might be in this and I might go over to a Shell on my computer and after a while that times out Well, this will keep that screen on and then when I'm done I can just exit out of the shell I can control C and exit out and now the screen will go back to sleep when I want so you can do how you want But that's what I would do Because I don't want it to always be on every time I plug it into USB But again by adb shell and they'll be links to all these notes in the description of this video I can run this and it will now basically like wiggle the mouse like you would on your computer every five seconds to prevent Sleep mode from happening. So if you have another way of doing this, let me know below But those are two main ways. I know of doing it and again That seems a little hacky anytime you have to do a senki event, but it works and I thought I'd share Thanks for watching and as always visit films by chris.com. That's Chris the Kate There's a link in the description and I hope that you have a great day