Skip to content

Instantly share code, notes, and snippets.

@samrayner
Created June 13, 2022 14:09
Show Gist options
  • Save samrayner/364f99ea5bae76b2f64db75c8c68964b to your computer and use it in GitHub Desktop.
Save samrayner/364f99ea5bae76b2f64db75c8c68964b to your computer and use it in GitHub Desktop.
deviceUdid=$(xcrun simctl create "my_simulator" "${IOS_DEVICE}" "iOS${IOS_VERSION}")
alias plistBuddy=/usr/libexec/PlistBuddy
simPrefs="$HOME/Library/Preferences/com.apple.iphonesimulator.plist"
plistBuddy -c "Set :DevicePreferences:$deviceUdid:ConnectHardwareKeyboard false" "$simPrefs" \
|| plistBuddy -c "Add :DevicePreferences:$deviceUdid:ConnectHardwareKeyboard bool false" "$simPrefs";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment