简体   繁体   中英

What is the difference between the abd reboot command manually pushing the power button on the android device?

I am trying to pragmatically push (longPress) the power button to display the reboot menu on the android device. I am aware after many research that we need to have system permission n order to do this.

This link has a very good explanation on how to do this, but my questions is how is adb reboot now different from manually pushing the power button?

As late as it is, there is still some useful insight to be explained here.

adb reboot is not only different from hitting the power button, it's also different than hitting the power button and then clicking on restart from the menu.

input keyevent 26 only locks the screen, because it is a quick tap on the power button. You'll have to go with sendevent /dev/input/eventXXX [...] & sleep 1 & sendevent [etc] in order to long-press the power button from adb, just as documented in your link.

adb reboot is completely different in that it immediately restarts the device. It is also different from rebooting from the power menu because adb reboot doesn't close apps, disconnect from the cell towers, or show the shutdown animation, it immediately kills the device like a battery pull.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM