snapshot/lib/snapshot/runner.rb in fastlane-2.9.0 vs snapshot/lib/snapshot/runner.rb in fastlane-2.10.0

- old
+ new

@@ -60,10 +60,14 @@ UI.user_error!(self.collected_errors.join('; ')) if self.collected_errors.count > 0 # Generate HTML report ReportsGenerator.new.generate + if Snapshot.config[:output_simulator_logs] + output_simulator_logs + end + # Clear the Derived Data unless Snapshot.config[:derived_data_path] FileUtils.rm_rf(TestCommandGenerator.derived_data_path) end end @@ -91,9 +95,20 @@ # if more than 1 set of arguments, use a tuple with an index if launch_arguments.count == 1 [launch_arguments] else launch_arguments.map.with_index { |e, i| [i, e] } + end + end + + def output_simulator_logs + Snapshot.config[:devices].each do |device_name| + device = TestCommandGenerator.find_device(device_name) + sim_device_logfilepath_source = File.expand_path("~/Library/Logs/CoreSimulator/#{device.udid}/system.log") + next unless File.exist?(sim_device_logfilepath_source) + + sim_device_logfilepath_dest = File.join(Snapshot.config[:output_directory], "#{device.name}_#{device.os_type}_#{device.os_version}_system.log") + FileUtils.cp(sim_device_logfilepath_source, sim_device_logfilepath_dest) end end def print_results(results) return if results.count == 0