lib/scan/detect_values.rb in scan-0.8.0 vs lib/scan/detect_values.rb in scan-0.9.0
- old
+ new
@@ -87,11 +87,11 @@
# Optionally, we only do this if the user specified a custom device or an array of devices
devices.each do |device|
lookup_device = device.to_s.strip.tr('()', '') # Remove parenthesis
found = FastlaneCore::SimulatorTV.all.detect do |d|
- (d.name + " " + d.tvos_version).include? lookup_device
+ (d.name + " " + d.os_version).include? lookup_device
end
if found
found_devices.push(found)
else
@@ -120,11 +120,15 @@
else
UI.user_error!("No TV simulators found on the local machine")
end
end
- # Is it an iOS, a tvOS or a MacOS device?
+ def self.min_xcode8?
+ Helper.xcode_version.split(".").first.to_i >= 8
+ end
+
+ # Is it an iOS, a tvOS or a macOS device?
def self.detect_destination
if Scan.config[:destination]
UI.important("It's not recommended to set the `destination` value directly")
UI.important("Instead use the other options available in `scan --help`")
UI.important("Using your value '#{Scan.config[:destination]}' for now")
@@ -136,10 +140,10 @@
if Scan.project.ios?
Scan.config[:destination] = Scan.devices.map { |d| "platform=iOS Simulator,id=#{d.udid}" }
elsif Scan.project.tvos?
Scan.config[:destination] = Scan.devices.map { |d| "platform=tvOS Simulator,id=#{d.udid}" }
else
- Scan.config[:destination] = ["platform=OS X"]
+ Scan.config[:destination] = min_xcode8? ? ["platform=macOS"] : ["platform=OS X"]
end
end
end
end