snapshot/lib/snapshot/test_command_generator.rb in fastlane-2.186.0 vs snapshot/lib/snapshot/test_command_generator.rb in fastlane-2.187.0

- old
+ new

@@ -43,11 +43,18 @@ UI.user_error!('All devices provided to snapshot should run the same operating system') end # on Mac we will always run on host machine, so should specify only platform return ["-destination 'platform=macOS'"] if devices.first.to_s =~ /^Mac/ - os = devices.first.to_s =~ /^Apple TV/ ? "tvOS" : "iOS" + case devices.first.to_s + when /^Apple TV/ + os = 'tvOS' + when /^Apple Watch/ + os = 'watchOS' + else + os = 'iOS' + end os_version = Snapshot.config[:ios_version] || Snapshot::LatestOsVersion.version(os) destinations = devices.map do |d| device = find_device(d, os_version) @@ -76,11 +83,18 @@ all_tvos = devices.map do |device| device = device.downcase device.include?('apple tv') end - # Return true if all devices are iOS devices + # Return true if all devices are tvOS devices return true unless all_tvos.include?(false) + + all_watchos = devices.map do |device| + device = device.downcase + device.include?('apple watch') + end + # Return true if all devices are watchOS devices + return true unless all_watchos.include?(false) # There should only be more than 1 device type if # it is iOS or tvOS, therefore, if there is more than 1 # device in the array, and they are not all iOS or tvOS # as checked above, that would imply that this is a mixed bag