Sha256: 236ba2addd9a7a6b9d0fe96af5634d865b07af796bcbb3a2cf64fcf0b6f38c03

Contents?: true

Size: 968 Bytes

Versions: 13

Compression:

Stored size: 968 Bytes

Contents

require_relative '../module'

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

13 entries across 13 versions & 1 rubygems

Version Path
fastlane-2.77.0.beta.20180117010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.1 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180116010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180115010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180114010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180113010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180112010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180111010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.76.0.beta.20180110010004 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.75.1 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.75.0 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
fastlane-2.75.0.beta.20180109010003 snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb