• Stars
    star
    338
  • Rank 124,931 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate required icon sizes and iconset from a master application icon.

appicon plugin

fastlane Plugin Badge

Demo image

Getting Started

This project is a fastlane plugin. To get started with fastlane-plugin-appicon, add it to your project by running:

fastlane add_plugin appicon

Please note that this plugin uses minimagick, which requires either GraphicsMagick or ImageMagick library. If you have neither, you can install either via Homebrew:

brew install graphicsmagick

or

brew install imagemagick

The default CLI for the mini_magick gem is set to auto pick. It will first try to use GraphicsMagick (if you have it installed) otherwise it will use ImageMagick. If you want to be explicit about which CLI you use, set the minimagick_cli option to graphicsmagick or imagemagick. Not specifying this option will set MiniMagick to use auto which will choose what's available.

About appicon

Generate required icon sizes and iconset from a master application icon.

Since many apps use a single 1024x1024 icon to produce all the required sizes from, why not automate the process and save lots of time?

Example

Check out the example Fastfile to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins and bundle exec fastlane test.

Just specify the source image using the appicon_image_file. Optionally specify the devices using appicon_devices and the destination path using appicon_path.

We recommend storing the full-size picture at fastlane/metadata/app_icon.png so it can be picked up by deliver, as well as this plugin.

If you want to use this plugin to generate a app icon for Messages(sticker) extension, set messages_extension to true and add messages to the appicon_devices.

lane :basic do
  appicon(
    appicon_devices: [:ipad, :iphone, :ios_marketing],
    appicon_path: "MajorKey/Assets.xcassets"
  )
end

lane :test1 do
  appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
             appicon_devices: [:ipad, :iphone, :ios_marketing])
end


lane :test2 do
  appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
             appicon_devices: [:ipad, :iphone, :ios_marketing, :watch, :watch_marketing])
end

lane :test3 do
  # `appicon_image_file` defaults to "fastlane/metadata/app_icon.png"
  appicon(
    appicon_devices: [:iphone],
    appicon_path: 'wwdcfamily/Images.xcassets' # output path
  )
end

lane :test4 do
  appicon(appicon_image_file: 'spec/fixtures/Themoji.png',
             appicon_devices: [:macos])
end

lane :splash_screen do
  appicon(
    appicon_image_file: 'spec/fixtures/splash_screen.png',
    appicon_devices: [:universal],
    appicon_path: "ios/App/App/Assets.xcassets",
    appicon_name: 'Splash.imageset'
  )
end

lane :messages_extension do
  appicon(
    appicon_image_file: "fastlane/metadata/iMessageAppIcon.png",
    appicon_devices: [:iphone, :ipad, :ios_marketing, :messages],
    appicon_path: 'iMessageStickers/Stickers.xcassets',
    messages_extension: true
  )
end

# or

lane :android do
  android_appicon(
    appicon_image_file: 'spec/fixtures/Themoji.png',
    appicon_icon_types: [:launcher],
    appicon_path: 'app/res/mipmap'
  )
  android_appicon(
    appicon_image_file: 'spec/fixtures/ThemojiNotification.png',
    appicon_icon_types: [:notification],
    appicon_path: 'app/res/drawable',
    appicon_filename: 'ic_notification',
    generate_rounded: true
  )
  android_appicon(
    appicon_image_file: 'spec/fixtures/splash_base_image.png',
    appicon_icon_types: [:splash_port, :splash_land],
    appicon_path: 'app/res/drawable',
    appicon_filename: 'splash'
  )
end

Run tests for this plugin

To run both the tests, and code style validation, run

rake

To automatically fix many of the styling issues, use

rubocop -a

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting doc in the main fastlane repo.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out fastlane.tools.

More Repositories

1

xcov

Nice code coverage reporting without hassle
Ruby
558
star
2

trainer

Convert xcodebuild plist and xcresult files to JUnit reports
Ruby
248
star
3

fastlane-plugin-s3

fastlane plugin to upload IPA or APK to AWS S3 by @joshdholtz
Ruby
146
star
4

danger-xcov

Danger plugin to validate the code coverage of the files changed in a pull request
Ruby
106
star
5

fastlane-plugin-ionic

Integrate your Ionic build into your Fastlane setup
Ruby
87
star
6

fastlane-plugin-clean_testflight_testers

Automatically remove TestFlight testers that are not actually testing your app
Ruby
66
star
7

security

A Ruby library for interacting with the macOS Keychain
Ruby
54
star
8

fastlane-ftp-plugin

Ftp plugin for Fastlane
Ruby
36
star
9

fastlane-plugin-slack_train

Show a nice train for the build progress in fastlane
Ruby
36
star
10

xcresult

Ruby interface for inspecting data and exporting data from Xcode 11 .xcresult files
Ruby
34
star
11

fastlane-plugin-validate_app

Validate your app with altool before uploading to iTunes Connect
Ruby
16
star
12

xcov-core

Command line tool to parse xccoverage files
Objective-C
14
star
13

fastlane-plugin-applivery

fastlane plugin to upload IPA or APK to Applivery.com
Ruby
12
star
14

fastlane-plugin-aws_sns

fastlane plugin for creating AWS SNS platform applications for iOS and Android apps by @joshdholtz
Ruby
12
star
15

fastlane-plugin-carthage_cache

A fastlane plugin that allows to cache Carthage/Build folder in Amazon S3.
Ruby
11
star
16

README

The collaboration and plugin inclusion guidelines for the fastlane Community organization
3
star
17

fastlane-plugin-get_current_swift_version

Get current Xcode toolchain's Swift version
Ruby
1
star