Help us understand the problem. What is going on with this article?

【Flutter】iOSとAndroidのアプリアイコンを一括生成する

More than 1 year has passed since last update.

Flutterアプリを作るときに、用意したアプリアイコンをiOS用とAndroid用のアプリアイコンとして一括生成(変換)する方法です。

結論

コマンドラインツールの flutter_launcher_icons を使う。

環境

  • Flutter 0.1.5
  • Dart 2.0.0-dev.28.0
  • flutter_launcher_icons 0.2.0

手順

1. flutter_launcher_icons Plugin追加

pubspec.yaml に flutter_launcher_icons を追加する。

pubspec.yaml
dev_dependencies: 
  flutter_test:
    sdk: flutter

  flutter_launcher_icons: "^0.2.0"

flutter_icons:
  image_path: "icon/icon.png" 
  android: true
  ios: true

2. アイコン準備

前述の image_path で指定したパスに用意したアイコンを置く。
今回の例だと、icon/icon.png

3. 一括生成実行

ターミナルで下記を実行する。

$ flutter pub get
$ flutter pub pub run flutter_launcher_icons:main

変更ファイル一覧

一括生成コマンド実行後に変更されたファイル一覧です。

+1 -1 M android/app/src/main/AndroidManifest.xml
+0 -0 M android/app/src/main/res/mipmap-hdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-mdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0 -0 A icon/ic_launcher.png
+71 -0 A ios/Podfile
+1 -1 M ios/Runner.xcodeproj/project.pbxproj
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png
+56 -0 M pubspec.lock
+5 -0 M pubspec.yaml

リンク

flutter_launcher_icons | Dart Package
https://pub.dartlang.org/packages/flutter_launcher_icons

How to change the application launcher icon on Flutter? - Stack Overflow
https://stackoverflow.com/questions/43928702/how-to-change-the-application-launcher-icon-on-flutter

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away