def download_profile(profile)
      UI.important("Downloading provisioning profile...")
      profile_name ||= "#{profile_type.pretty_type}_#{Sigh.config[:app_identifier]}"

      if Sigh.config[:platform].to_s == 'tvos'
        profile_name += "_tvos"
      end

      if Sigh.config[:platform].to_s == 'macos'
        profile_name += '.provisionprofile'
      else
        profile_name += '.mobileprovision'
      end

      tmp_path = Dir.mktmpdir("profile_download")
      output_path = File.join(tmp_path, profile_name)
      File.open(output_path, "wb") do |f|
        f.write(profile.download)
      end

      UI.success("Successfully downloaded provisioning profile...")
      return output_path
    end
def download_profile(profile)
      UI.important("Downloading provisioning profile...")
      profile_name ||= "#{profile_type.pretty_type}_#{Sigh.config[:app_identifier]}"

      if Sigh.config[:platform].to_s == 'tvos'
        profile_name += "_tvos"
      end

      if Sigh.config[:platform].to_s == 'macos'
        profile_name += '.provisionprofile'
      else
        profile_name += '.mobileprovision'
      end

      tmp_path = Dir.mktmpdir("profile_download")
      output_path = File.join(tmp_path, profile_name)
      File.open(output_path, "wb") do |f|
        f.write(profile.download)
      end

      UI.success("Successfully downloaded provisioning profile...")
      return output_path
    end
Downloads and stores the provisioning profile