I want to simulate pressing the power button on a rooted Samsung Galaxy Tab 2 GT-P5100
running Android 4.0.4 using the ADB shell.
To do this I changed the relevant permissions using:
adb shell
su
chmod 666 /dev/input/event1
How do I know whether this was successful?
I thought that the following command would display the lock screen:
input keyevent 116
I get no errors, but nothing happens...
Alternatively I used the text form of the key code which looks like this:
input keyevent KEY_POWER
In this case, the output is Killed
- What does this mean?
Lastly, I tried:
sendevent dev/input/event1 1 116 1 ; sendevent dev/input/event1 1 116 0
With no luck :(
What am I doing wrong?
getevent -i /dev/input/event1
outputs the following:
add device 1: /dev/input/event1
bus: 0000
vendor: 0000
product: 0000
version: 0000
name: "sec_key"
location: ""
id: ""
version: 1.0.1
events:
KEY (0001): 0072 0073 0074
input props:
<none>
The key 0074
has the textual label KEY_POWER
.