Skip to content

Commit f675795

Browse files
committed
fix: better way of disabling auto-correction on ios
1 parent 163d237 commit f675795

4 files changed

Lines changed: 16 additions & 26 deletions

File tree

.maestro/enrichedInput/flows/inline_code_paste_into_codeblock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ appId: swmansion.enriched.example
2121

2222
- doubleTapOn:
2323
id: 'editor-input'
24-
point: '8%, 25%'
24+
point: '10%, 30%'
2525

2626
- tapOn:
2727
text: 'Copy'

.maestro/scripts/run-tests.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ run_maestro() {
144144
return "$rc"
145145
}
146146

147-
if [ "$PLATFORM" = ios ]; then
148-
echo "=== Running iOS device setup ==="
149-
run_maestro --device "$DEVICE_ID" "$MAESTRO_ROOT/setup/ios_keyboard_settings.yaml"
150-
fi
151-
152147
set +e
153148

154149
echo "=== Running maestro tests ==="

.maestro/scripts/setup-ios-simulator.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ if [ -z "$UDID" ]; then
2525
exit 1
2626
fi
2727

28+
# disable automatic text manipulation: auto-correction, spelling-check and auto-capitalization
29+
SIM_PREFS_DIR="$HOME/Library/Developer/CoreSimulator/Devices/$UDID/data/Library/Preferences"
30+
mkdir -p "$SIM_PREFS_DIR"
31+
32+
PLIST="$SIM_PREFS_DIR/com.apple.keyboard.preferences.plist"
33+
34+
/usr/libexec/PlistBuddy -c "Add :KeyboardAutocorrection bool false" "$PLIST" 2>/dev/null || \
35+
/usr/libexec/PlistBuddy -c "Set :KeyboardAutocorrection bool false" "$PLIST"
36+
37+
/usr/libexec/PlistBuddy -c "Add :KeyboardCheckSpelling bool false" "$PLIST" 2>/dev/null || \
38+
/usr/libexec/PlistBuddy -c "Set :KeyboardCheckSpelling bool false" "$PLIST"
39+
40+
/usr/libexec/PlistBuddy -c "Add :KeyboardAutocapitalization bool false" "$PLIST" 2>/dev/null || \
41+
/usr/libexec/PlistBuddy -c "Set :KeyboardAutocapitalization bool false" "$PLIST"
42+
2843
STATE=$(xcrun simctl list devices | grep "$UDID" | grep -oE '\(Booted\)|\(Shutdown\)' || true)
2944
if [ "$STATE" != "(Booted)" ]; then
3045
echo "Booting '$DEVICE_NAME' ($UDID)..."

.maestro/setup/ios_keyboard_settings.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)