lib/snapshot/runner.rb in snapshot-1.3.0 vs lib/snapshot/runner.rb in snapshot-1.4.0
- old
+ new
@@ -97,12 +97,14 @@
File.write("/tmp/snapshot-launch_arguments.txt", launch_arguments.last)
Fixes::SimulatorZoomFix.patch
Snapshot.kill_simulator # because of https://github.com/fastlane/snapshot/issues/337
- `xcrun simctl shutdown booted`
+ `xcrun simctl shutdown booted &> /dev/null`
+ uninstall_app(device_type) if Snapshot.config[:reinstall_app]
+
command = TestCommandGenerator.generate(device_type: device_type)
Helper.log_alert("#{device_type} - #{language}")
prefix_hash = [
@@ -134,9 +136,20 @@
end
end)
raw_output = File.read(TestCommandGenerator.xcodebuild_log_path)
Collector.fetch_screenshots(raw_output, language, device_type, launch_arguments.first)
+ end
+
+ def uninstall_app(device_type)
+ Helper.log.debug "Uninstalling app '#{Snapshot.config[:app_identifier]}' from #{device_type}..."
+ device_udid = TestCommandGenerator.device_udid(device_type)
+
+ Helper.log.info "Launch Simulator #{device_type}".yellow
+ `xcrun instruments -w #{device_udid} &> /dev/null`
+
+ Helper.log.info "Uninstall application #{Snapshot.config[:app_identifier]}".yellow
+ `xcrun simctl uninstall #{device_udid} #{Snapshot.config[:app_identifier]} &> /dev/null`
end
def clear_previous_screenshots
Helper.log.info "Clearing previously generated screenshots".yellow
path = File.join(".", Snapshot.config[:output_directory], "*", "*.png")