How to disable screen lock during Android development? I am developing Android app with my daily phone, I want to turn off screen lock only during development. 

I can do this manually, but that is too troublesome and sometimes I forget to enable it back after development.

Are there ways to do this automatically? i.e. turn off screen lock when connected to USB?
There are other ways too. My favorite is:

$ adb shell svc power stayon true


See here: https://stackoverflow.com/questions/8840954/how-do-i-keep-my-screen-unlocked-during-usb-debugging