def download(app_id, dir = nil)
      dir ||= "/tmp"

      UI.message("Going to download app metadata from App Store Connect")
      command = @transporter_executor.build_download_command(@user, @password, app_id, dir, @provider_short_name)
      UI.verbose(@transporter_executor.build_download_command(@user, 'YourPassword', app_id, dir, @provider_short_name))

      begin
        result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
      rescue TransporterRequiresApplicationSpecificPasswordError => ex
        handle_two_step_failure(ex)
        return download(app_id, dir)
      end

      return result if Helper.test?

      itmsp_path = File.join(dir, "#{app_id}.itmsp")
      successful = result && File.directory?(itmsp_path)

      if successful
        UI.success("✅ Successfully downloaded the latest package from App Store Connect to #{itmsp_path}")
      else
        handle_error(@password)
      end

      successful
    end
def download(app_id, dir = nil)
      dir ||= "/tmp"

      UI.message("Going to download app metadata from App Store Connect")
      command = @transporter_executor.build_download_command(@user, @password, app_id, dir, @provider_short_name)
      UI.verbose(@transporter_executor.build_download_command(@user, 'YourPassword', app_id, dir, @provider_short_name))

      begin
        result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
      rescue TransporterRequiresApplicationSpecificPasswordError => ex
        handle_two_step_failure(ex)
        return download(app_id, dir)
      end

      return result if Helper.test?

      itmsp_path = File.join(dir, "#{app_id}.itmsp")
      successful = result && File.directory?(itmsp_path)

      if successful
        UI.success("✅ Successfully downloaded the latest package from App Store Connect to #{itmsp_path}")
      else
        handle_error(@password)
      end

      successful
    end
Returns a new instance of the iTunesTransporter.
 If no username or password given, it will be taken from
 the #{CredentialsManager::AccountManager}
 @param use_shell_script if true, forces use of the iTMSTransporter shell script.
                         if false, allows a direct call to the iTMSTransporter Java app (preferred).
                         see: https://github.com/fastlane/fastlane/pull/4003
 @param provider_short_name The provider short name to be given to the iTMSTransporter to identify the
                            correct team for this work. The provider short name is usually your Developer
                            Portal team ID, but in certain cases it is different!
                            see: https://github.com/fastlane/fastlane/issues/1524#issuecomment-196370628
                            for more information about how to use the iTMSTransporter to list your provider
                            short names
 Downloads the latest version of the app metadata package from iTC.
 @param app_id [Integer] The unique App ID
 @param dir [String] the path in which the package file should be stored
 @return (Bool) True if everything worked fine
 @raise [Deliver::TransporterTransferError] when something went wrong
   when transferring