当前位置:Gxlcms > 数据库问题 > python+adb实现物理按键长按(比如长按关机)

python+adb实现物理按键长按(比如长按关机)

时间:2021-07-01 10:21:17 帮助过:101人阅读

os import time os.system("adb shell sendevent /dev/input/event0 1 116 1") os.system("adb shell sendevent /dev/input/event0 0 0 0") time.sleep(10) // 实现长按操作

这里我们使用sleep函数,设置等待事件来达到长按物理按键的目的。

python+adb实现物理按键长按(比如长按关机)

标签:操作   power   system   图片   抓取   按键   mamicode   实现   adb shell   

人气教程排行