I want to use terminal task to to turn the screen off using tasker. I have tried a code like this, and some variants, without success.

am start --user 0 -a android.intent.extra.KEY_EVENT --es KEYCODE_POWER ACTION_DOWN

I have also tinkered with 


 but with even less success.

Any ideas as how how I can get this to work? Either with terminal emulator or tasker send intent task?

Note: Not rooted, som shell task in will not work.

And System Lock doesn't work well with finger print reader


By use adb shell input keyevent <key_code> And for simulating your device power the key code is 26

Adb shell input keyevent 26
  • Doesn't work on an unrooted device, when you want to do it on the device itself (not through adb) – Snorre Rubin May 10 '17 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.