Android ADB:模拟Recent App按键

Use*_*uck 16 android adb

有没有办法让ADB模拟Recent App按键?我没有在分配的键列表中看到它,adb input shell tap尽管从调试选项中获取了坐标,但我无法使用它.

我试图在我自己的个人电话(带软键的Nexus 5)上自动执行任务,所以任何hacky方式都没问题,假设没有一个干净的方法来做到这一点.

Sim*_*uis 22

解决方案是使用KEYCODE_APP_SWITCHKeyEvent:

adb shell input keyevent KEYCODE_APP_SWITCH
Run Code Online (Sandbox Code Playgroud)


mat*_*ash 11

请参阅下面的@SimonMarquis答案

adb shell input keyevent KEYCODE_APP_SWITCH
Run Code Online (Sandbox Code Playgroud)

(过时)

我不认为它有一个密钥代码.

不过,我能够与打开最近使用的应用菜单adb shell input tap(在Nexus 5测试棒棒糖).例如:

adb shell input tap 800 1890
Run Code Online (Sandbox Code Playgroud)