Sha256: 2011d7c1560d1c35dbb40d965e64bb3e8009ddeda32192f4b8955c24c6ecfa13

Contents?: true

Size: 937 Bytes

Versions: 96

Compression:

Stored size: 937 Bytes

Contents

module Snapshot
  module Fixes
    # This fix is needed due to a bug in UI Tests that creates invalid screenshots when the
    # simulator is not scaled to a 100%
    # Issue: https://github.com/fastlane/snapshot/issues/249
    # Radar: https://openradar.appspot.com/radar?id=6127019184095232

    class SimulatorZoomFix
      def self.patch
        UI.message "Patching simulators '#{config_path}' to scale to 100%"

        FastlaneCore::DeviceManager.simulators.each do |simulator|
          simulator_name = simulator.name.tr("\s", "-")
          key = "SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.#{simulator_name}"

          Helper.backticks("defaults write '#{config_path}' '#{key}' '1.0'", print: FastlaneCore::Globals.verbose?)
        end
      end

      def self.config_path
        File.join(File.expand_path("~"), "Library", "Preferences", "com.apple.iphonesimulator.plist")
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
fastlane-2.74.0.beta.20180106010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.73.0 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.73.0.beta.20180105010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.73.0.beta.20180104010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.73.0.beta.20180103010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20180102010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20180101010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20171231010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.1 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20171230010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20171229010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.72.0.beta.20171228010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171227010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171226010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171225010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171224010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171223010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.71.0.beta.20171222010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb