In addition to the answers before, here's what I do to lock / unlock my screen using adb:
adb shell input keyevent 26
will lock the screen.
So, if you execute that command again, while the screen is turned off / locked, it will be turned on / unlocked.
adb shell input keyevent 26
will also unlock the screen (if the screen is locked).
Furthermore, I have also tested all commands, such as adb shell input keyevent number
, and found out that adb shell input keyevent 3
also unlock the device.
I had also found out (by testing) that key 3 is the home button. So , if you have a physical home button (not the soft home button on the screen), you can also use this to unlock your device.