葫芦-Android:我们可以模拟对葫芦,Android的Andr​​oid设备Home键?葫芦、我们可以、设备、Andr

2023-09-06 08:44:29 作者:抢我对象者不孕不育

我们可以模拟对葫芦,Android的Andr​​oid设备Home键?我需要在Home键轻按在我们的脚本中使用葫芦执行我的脚本。

Can we simulate Home button on Android devices for Calabash-Android? I need to tap on Home button in our scripts to execute my Scripts using Calabash.

推荐答案

我还没有试过这种没有自己。但四处寻找一个解决方案我发现这一点。

I have not tried this yet myself. But looking around for a solution I did find this.

链接的http://krazyrobot.com/2014/02/calabash-android-enter-text-from-keyboard-using-adb/由鲍拉日·巴拉兹又名 krazyrobot

他的解决方案是使用发送键codeS,为家庭按钮是关键code_HOME。该包装成葫芦会给你:

His solution is to use send keycodes, for the home button that is KEYCODE_HOME. Wrapping that into calabash would give you:

系统(亚行外壳输入KEY的KeyEvent code_HOME)

我又没有尝试过这一点,但它听起来像一个解决方案。

Again I have not tried this, but it sounds like a solution.