本文介紹了Calabash Android:如何將應用程序發送到后臺(模擬設備/硬件主頁按鈕)?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
Calabash Android 中有沒有一種方法可以將我的應用程序發送到后臺?也就是說,模擬設備/硬件Home鍵?
Is there a way in Calabash Android where I can send my app to the background? In other words, simulate the device/hardware Home button?
其次,能否將應用帶回前臺?
Secondly, can the app be brought back into the foreground?
推薦答案
可以通過以下方式完成:
This can be done in the following way:
Then /^I go home$/ do
system "#{default_device.adb_command} shell input keyevent KEYCODE_HOME"
end
附言如有必要,您還可以在 system "..."
行之后添加 sleep <some_value_in_seconds>
.
這篇關于Calabash Android:如何將應用程序發送到后臺(模擬設備/硬件主頁按鈕)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!