Sha256: 95240d4ab25b559d3b0233ded50d8e55a0b327261f6466c0c307c45f6dab3765

Contents?: true

Size: 1.38 KB

Versions: 490

Compression:

Stored size: 1.38 KB

Contents

require_relative '../module'

module Snapshot
  module Fixes
    # Having "Connect Hardware Keyboard" enabled causes issues with entering text in secure textfields
    # Fixes https://github.com/fastlane/fastlane/issues/2494

    class HardwareKeyboardFix
      def self.patch
        UI.verbose("Patching simulator to work with secure text fields")

        Helper.backticks("defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0", print: FastlaneCore::Globals.verbose?)

        # For > Xcode 9
        # https://stackoverflow.com/questions/38010494/is-it-possible-to-toggle-software-keyboard-via-the-code-in-ui-test/47820883#47820883
        Helper.backticks("/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", print: FastlaneCore::Globals.verbose?)
      end
    end
  end
end

Version data entries

490 entries across 490 versions & 5 rubygems

Version Path
fastlane-2.225.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.224.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.223.1 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.223.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.222.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.221.1 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.221.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.220.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.219.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.218.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-security-patched-2.216.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.217.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.216.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.215.1 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.215.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-mercafacil-2.214.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.214.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.213.0 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane-2.212.2 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb
fastlane_pricing_fix-2.212.1 snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb