Disable Hardware Keyboard for iOS Simulator using UIAutomation
If I understood your question correctly, you need bulletproof way to enter text. I just use setValue for that. Like this: UIATarget.localTarget().frontMostApp().textFields().Login.setValue('sofa');
How to type an @ in iOS simulator using the hardware keyboard?
Sounds like it's your keyboard layout. Option + L renders ¬ on both macOS and iOS for me. If you have an American English keyboard layout you probably want Shift + 2. If you prefer to use the keyboard layout you're accustomed to you might need to configure it in the simulator.
Is it possible to toggle software keyboard via the code in UI test?
The simulator's .plist file changed to add support for multiple simulators. The ConnectHardwareKeyboard boolean is now nested underneath the device's UDID. Luckily this UDID is also stored in the plist file. You can add this code using 'run script' under your UITest target's build phases.
Xcode 9 answer:
#grab the UDID from the plist
UDID=$(defaults read com.apple.iphonesimulator CurrentDeviceUDID)
#overwrite the existing value with false
#OR if the plist doesn't have that value add it in
/usr/libexec/PlistBuddy -c "Set :DevicePreferences:$UDID:ConnectHardwareKeyboard
false" ~/Library/Preferences/com.apple.iphonesimulator.plist
||
/usr/libexec/PlistBuddy -c "Add :DevicePreferences:$UDID:ConnectHardwareKeyboard
bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist
Or you can use this other code to affect all simulators:
/usr/libexec/PlistBuddy -c "Print :DevicePreferences" ~/Library/Preferences/com.apple.iphonesimulator.plist | perl -lne 'print $1 if /^ (\S*) =/' | while read -r a; do /usr/libexec/PlistBuddy -c "Set :DevicePreferences:$a:ConnectHardwareKeyboard
false" ~/Library/Preferences/com.apple.iphonesimulator.plist || /usr/libexec/PlistBuddy -c "Add :DevicePreferences:$a:ConnectHardwareKeyboard
bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist; done
how to disable ios simulator keyboard in xcode 12?
This should help:driver.hideDeviceKeyboard();
See docs for details.
Related Topics
How to Read Incoming Sms by Using Application in iOS
Ios7 - Device Unique Identifier
Xcode Duplicate Symbols for Architecture Error After Updating Cocoa Pods
Draggesture on a VStack with Lot of Buttons, How to Detect When the Drag Is Inside a Button
Firebase API Is Not Sending Push Notifications When Using the API
Avassetwriter Avvideoexpectedsourceframeratekey (Frame Rate) Ignored
Using Private API to Read Wifi Rssi Value
Cells Order in Uicollectionview
Codesign Returned Errsecinternalcomponent in High Sierra
Track Cellular Data Usage Using Swift
Dequeuereusablecellwithidentifier Never Returns Nil
iOS Unrecognized Selector Sent to Instance in Swift
Healthkit Authorisation Status Is Always 1
Swipe to Go Back Only Works on Edge of Screen
Play a Video from Youtube in a Avplayerviewcontroller in Swift
Firebase Queryorderedbychild() Method Not Giving Sorted Data
How to Automatically Convert Manual Retain-Release Code to Arc