Unlock Screen with ADB Android 4.2 Previously with Android 4.1, doing something like: 

adb shell input keyevent 82  
#(KEYCODE_MENU)


would unlock the screen at first boot and would then allow further commands to launch applications and have them displayed on the screen, etc.

With 4.2, within 10s of boot, the lockscreen dims to black. Issuing the same ADB command no longer works and the screen remains blank. 

If I manually press the menu key, this brings the screen back on, and I can then issue the keyevent to unlock the screen. 

Any ideas how I can bring the display back up from ADB and unlock the screen from there? 

Thanks
If you are on 4.2.2, you might want to read e.g. ADB Whitelist As of the Android 4.2.2: Starting with this Android version, "remote devices" (i.e. those you run ADB commands from) must be authorized by the Android device (i.e. the one those commands are runnin on) -- so your Android device can tell "trusted callers" from "malicious attackers". You can also find this in detail on this article on AndroidPolice:


  The way it works is pretty simple - when you connect your PC to your Android device via USB, Android gets your PC's RSA key (an identifier token). In Android 4.2.2, when you have USB debugging enabled, this now causes a prompt to appear on connection, seen below.



(image source: AndroidPolice)

Update from the comments below:

Additionally, as Shurane pointed out, behavior of adb keyevent seems to have changed with Android 4.2.2: while before adb keyevent 26 was a dedicated "screen-off", and adb shell input keyevent 82 a dedicated "screen-on" switch, now adb keyevent 26 is a toggle which turns the screen off (when it's on) and on (when it's off), as noted by Pepelac.