This worked for me on Android 4.3 (actually it was CyanogenMod 10.2.1). Came really handy when I rebooted my phone, forgot to unlock it and a Tasker profile turned Airplane Mode on. In this state the OS wouldn't accept any PIN combination for unlocking the phone, so until Airplane Mode was on, I couldn't use the phone at all.

P.S.: your phone doesn't have to be rooted for this to work! Although on later Android versions each USB (ADB) connection has to be approved prior first use. So you'll need a computer that is already approved on the phone.