UiAutomator如何实现长按电源键(KeyEvent 26)获取电源菜单?
最佳答案
下面是长按home键的解决方案,可以用。也许你可以尝试使用power KeyCode代替mDevice.pressHome()。
public void longPressHome(){
long timeout = Configurator.getInstance().getActionAcknowledgmentTimeout();
Configurator.getInstance().setActionAcknowledgmentTimeout(0);
mDevice.pressHome();
mDevice.pressHome();
Configurator.getInstance().setActionAcknowledgmentTimeout(timeout);
}
关于android - 通过 UiAutomator 长按电源按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37909053/