def add_media(device_types, media_type, paths)
      media_type = media_type.to_s

      device_types.each do |device_type|
        UI.verbose("Adding #{media_type}s to #{device_type}...")
        device_udid = TestCommandGenerator.device_udid(device_type)

        UI.message("Launch Simulator #{device_type}")
        Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")

        paths.each do |path|
          UI.message("Adding '#{path}'")

          # Attempting addmedia since addphoto and addvideo are deprecated
          output = Helper.backticks("xcrun simctl addmedia #{device_udid} #{path.shellescape} &> /dev/null")

          # Run legacy addphoto and addvideo if addmedia isn't found
          # Output will be empty strin gif it was a success
          # Output will contain "usage: simctl" if command not found
          if output.include?('usage: simctl')
            Helper.backticks("xcrun simctl add#{media_type} #{device_udid} #{path.shellescape} &> /dev/null")
          end
        end
      end
    end
def add_media(device_types, media_type, paths)
      media_type = media_type.to_s

      device_types.each do |device_type|
        UI.verbose("Adding #{media_type}s to #{device_type}...")
        device_udid = TestCommandGenerator.device_udid(device_type)

        UI.message("Launch Simulator #{device_type}")
        Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")

        paths.each do |path|
          UI.message("Adding '#{path}'")

          # Attempting addmedia since addphoto and addvideo are deprecated
          output = Helper.backticks("xcrun simctl addmedia #{device_udid} #{path.shellescape} &> /dev/null")

          # Run legacy addphoto and addvideo if addmedia isn't found
          # Output will be empty strin gif it was a success
          # Output will contain "usage: simctl" if command not found
          if output.include?('usage: simctl')
            Helper.backticks("xcrun simctl add#{media_type} #{device_udid} #{path.shellescape} &> /dev/null")
          end
        end
      end
    end
pass an array of device types