'How to hide keyboard of ios real device with appium interface

I want to hide keyboard of my real device from appium interface. Is there any capability that i can use ? I tried some solutions but it didn't work for me. We are using hideKeyboard() on the code side but i dont know what we can use on interface of appium. Can you help me pls?

Here is the snippet:

{
"platformName": "iOS", 
"platformVersion": "13.2.3", 
"deviceName": "iPhone 6s", 
"udid": "udid of ios phone", 
"bundleId": "bundleId of app", 
"automationName": "XCUITest", 
"noReset": true, 
"fullReset": false 
}


Solution 1:[1]

Try this code:

public static IOSDriver<IOSElement> iosDriver;
iosDriver.hideKeyboard();

work for me on simulator and real iOS devices

Or you can try this code:

public void hideKeyboard() {
    driver().switchTo().activeElement().sendKeys(Keys.RETURN);
}

This work when you have active form input element, and this function tap return in button in keyboard

Solution 2:[2]

self.driver.hide_keyboard()

You can visit here to know more about the library.Hide the keyboard

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Marc Steven