Multiple attempts to find the best icon
In order to properly give precedence to higher DPI images, you need to do three separate finds like your code already does. However, this part can be cleaned up, as well as getting rid of the unnecessary icon.try do ... end call.

begin
  icon = icons.find { |name, _| name.downcase.include? 'xxxhdpi' }
      || icons.find { |name, _| name.downcase.include? 'xxhdpi' }
      || icons.find { |name, _| name.downcase.include? 'xhdpi' }

  return unless icon.defined?

  File.open(tmp_icon.path.to_s, 'wb') { |f| f.write icon[:data] }
  s3_icon = bucket.objects[icon_path].write(Pathname.new(tmp_icon.path),
                                            content_type: 'image/png')
  icon_url = s3_icon.public_url(secure: true)
ensure
  tmp_icon.close
  tmp_icon.unlink
end