If you are using android mobile phone for usb android development and debugging, it may be quite annoying to see it going to sleep mode after every few seconds or minutes. You can possibly increase the sleep window time but that is not a good solution. You probably want to disable sleep only during developing and when phone is connected to usb port. Here are quick steps to disable sleep mode and keeping android phone awake during usb debugging:
- Ensure that usb debugging is enabled on your phone.
Open settings screen on your phone and select “Developer options” as shown below:
On Developer options screen, select “Stay awake” if it is not already selected as shown below:
Note that this will case screen to never sleep while charging. This way you won’t have to be worried about mobile battery getting drained accidentally.