Class: Snapshot::Fixes::SimulatorZoomFix
- Inherits:
-
Object
- Object
- Snapshot::Fixes::SimulatorZoomFix
- Defined in:
- snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb
Overview
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: github.com/fastlane/fastlane/issues/2578 Radar: openradar.appspot.com/radar?id=6127019184095232
Class Method Summary collapse
Class Method Details
.config_path ⇒ Object
22 23 24 |
# File 'snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb', line 22 def self.config_path File.join(File.("~"), "Library", "Preferences", "com.apple.iphonesimulator.plist") end |
.patch ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb', line 11 def self.patch UI.("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 |