# Generate App Icons for Every Platform of a Flutter App

Yes. An agent adds flutter_launcher_icons, regenerates Android, iOS, macOS, Windows and web icons from one source image, keeps adaptive icons and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-app-icons/flutter/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent clones the app into its own cloud sandbox and reads where the icons live today, platform by platform. In an app like simplezhli/flutter_deer, `pubspec.yaml` is at version `1.3.3+22` with an SDK constraint of `>=3.4.0` and Flutter `>=3.19.0`, and `dev_dependencies` lists only `flutter_test`, `flutter_driver`, `integration_test` and `test`: no icon generator. On Android, `AndroidManifest.xml` points `android:icon` at `@mipmap/ic_launcher`, the five `mipmap-*` folders hold `ic_launcher.png` from 48 pixels at `mdpi` to 192 at `xxxhdpi`, and `mipmap-anydpi-v26/ic_launcher.xml` declares an adaptive icon with `@drawable/ic_launcher_background`, `@drawable/ic_launcher_foreground` and a `monochrome` layer reusing the foreground; but the foreground and background PNGs exist only in `drawable-xxhdpi` at 324 pixels and `drawable-xxxhdpi` at 432, so lower densities scale down. On iOS, `AppIcon.appiconset` holds fifteen PNGs from `20x20@1x` to the `1024x1024` marketing icon with their `Contents.json`; macOS has `app_icon_16` through `app_icon_1024`; Windows has `runner/resources/app_icon.ico` referenced from `Runner.rc`; and `web/icons` has `Icon-192.png` and `Icon-512.png` listed in `web/manifest.json`, with no maskable variants and a `background_color` of `#0175C2`, the Flutter template's default blue, beside a `favicon.png` of 16 pixels.

There is no single source image to generate from: `assets/images/logo.png` is 437 by 412 pixels and used inside the app. The agent does not invent artwork. It takes the one 1024-pixel square the repository already has, the iOS marketing icon, copies it to `assets/icon/app_icon.png` as the committed source, and takes the existing `drawable-xxxhdpi` foreground and background PNGs as the adaptive layers so the Android look is unchanged. It then adds `flutter_launcher_icons` to `dev_dependencies` and writes `flutter_launcher_icons.yaml`: `image_path` to the new source, `android: true` with `adaptive_icon_foreground`, `adaptive_icon_background` and `adaptive_icon_monochrome` set to the two existing drawables, `ios: true` with `remove_alpha_ios: true` because App Store Connect rejects icons with an alpha channel, and `macos`, `windows` and `web` sections with `generate: true`, an `icon_size` of 256 for the Windows `.ico`, and `background_color` and `theme_color` for the web manifest taken from the app's own theme rather than the template blue.

Running `dart run flutter_launcher_icons` regenerates every target from those inputs: all five Android densities of `ic_launcher.png`, the adaptive layers at every density instead of two, the full iOS set with a rewritten `Contents.json`, the macOS set, a multi-size `app_icon.ico`, and `Icon-192`, `Icon-512` and their `maskable` variants in `web/icons` with `web/manifest.json` updated to list them. The agent leaves `AndroidManifest.xml`, `Runner.rc` and the Xcode projects untouched because the generator writes to the names they already reference, and it does not change `applicationId`, `com.weilu.deer`, or the display name `Flutter Deer`.

Then it proves nothing else moved. It installs the Flutter release the repository's own workflow pins in `subosito/flutter-action`, runs `flutter pub get`, the generator, `flutter analyze` with the repository's strict `analysis_options.yaml`, and `flutter build web`, which needs no Android SDK or Xcode and shows the web icons and manifest in `build/web`. It does not try an Android build, because `android/app/build.gradle` loads `app/key.properties` with a `FileInputStream` that fails when the keystore file is absent, and the pull request says so. The diff is reviewed as images: the description lists every regenerated file with its pixel size before and after, read from the PNG headers, so a reviewer can see that `mipmap-xxxhdpi` is still 192 pixels and the adaptive layers now exist at every density.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Set up app icon generation for this Flutter app so every platform's icons come from one source. Read pubspec.yaml, the Android manifest and res folders, the iOS and macOS appiconsets, the Windows runner resources, web/manifest.json and web/icons, and the GitHub workflows first, and record the pixel size of every existing icon. Do not invent artwork: use the largest square icon already in the repository as the committed source image, and reuse the existing adaptive icon foreground and background drawables. Add flutter_launcher_icons as a dev dependency with a config that covers Android with adaptive and monochrome layers, iOS with alpha removed, macOS, Windows and web with maskable icons and the app's own theme colours. Install the Flutter version the workflow pins, run pub get, run the generator, run flutter analyze and flutter build web, and open a pull request that lists every regenerated file with its size before and after and explains why no Android build was attempted.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request adding `flutter_launcher_icons` to `pubspec.yaml`, a `flutter_launcher_icons.yaml`, a committed source image under `assets/icon/`, and regenerated icon files on all five platforms with their `Contents.json` and `web/manifest.json` updated. The description is a table of every icon path with its pixel size before and after, which is how a reviewer checks an image-only diff without opening each file.

The run's record keeps `flutter pub get`, the generator's output naming each platform it wrote, `flutter analyze` and `flutter build web` from the sandbox, so a reviewer knows the project still analyses and builds with the new files in place.

Before merging, a reviewer opens the regenerated icons on a device or simulator for the platforms they ship, checks that the adaptive icon looks as before on Android 8 and later, and decides whether to replace the source image with a designed 1024-pixel original, after which the same command regenerates everything.

## Run it on every app with hand-made icons

A developer hands this off from the terminal: one `POST /o/{org}/sessions` with this body and the repository in `resources`. A studio with several Flutter apps sends one request per repository, each with a `request_id` that is a UUID v5 of the repository path so a retry returns the run it already started, and the key's `webhook_url` reports each finished run with its pull request.

After the merge, a new icon is one file and one command, and the same run can be sent again when the brand changes.

## Why run it on Rush?

Icon work is a long list of exact pixel sizes across five platform folders, and a mistake shows up as a rejected store submission or a blurry home screen. The agent reads every size in its own sandbox, keeps the artwork the app already has, generates the full set with the standard tool, and records each file's size before and after, so the review is a table instead of fifty image diffs.

Running the project's own `flutter analyze` and `flutter build web` in the sandbox, with the Flutter version the repository pins, is what makes the pull request trustworthy without an Android or iOS build, and the record shows why those two were not attempted.

## Frequently asked questions

### Will the icons look different after this?

They are generated from the icon the app already ships, the 1024-pixel iOS marketing image, and the existing adaptive layers, so the look is the same. What changes is that every density and platform now matches that one source, including the lower densities that only existed by scaling before.

### Why is a copy of the iOS icon committed as the source?

Because the generator needs one square image and the repository has no designed original; the marketing icon is the largest square it holds. The pull request names that file as the thing to replace with a real 1024-pixel source, and everything regenerates from it.

### Does this touch the Android manifest or the Xcode project?

No. The generator writes to the file names those projects already reference, `ic_launcher`, `AppIcon.appiconset`, `app_icon.ico` and `web/icons`, so the manifest, `Runner.rc` and both Xcode projects stay as they are.

### Why no Android build in the sandbox?

The app's `build.gradle` reads `app/key.properties` unconditionally and fails without the keystore, which is not in the repository. The agent runs `flutter analyze` and a web build instead, and says in the pull request that the Android and iOS builds belong to the reviewer's machine.

### What about the web manifest colours?

The old `web/manifest.json` kept the Flutter template's blue background. The config sets the background and theme colours from the app's own theme and adds maskable icons, so the installed web app matches the mobile one.

## More Flutter jobs

- [Add Fingerprint and Face ID Login to a Flutter App](https://getrush.ai/run/add-biometric-auth/flutter/)
- [Add Dev and Production Build Flavors to a Flutter App](https://getrush.ai/run/add-build-flavors/flutter/)
- [Add Test Coverage Reporting to a Flutter App's CI](https://getrush.ai/run/add-coverage-to-ci/flutter/)

## More jobs like this: Hand off a long task

- [Add an App Proxy to a Shopify App](https://getrush.ai/run/add-app-proxy/shopify-app/)
- [Convert an Argo CD App-of-Apps Chart Into an ApplicationSet](https://getrush.ai/run/add-applicationset/argo-cd/)
- [Add Argument Specs to an Ansible Role](https://getrush.ai/run/add-argument-specs/ansible/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
