The first thing a user sees of your app is not your UI. It is an icon on a home screen and then a splash screen. Both are routinely wrong in Ionic apps: blurry icons, stretched splash images, a white flash before the first paint, and Android showing a tiny icon in a circle. This tutorial fixes all of it with a repeatable setup.
1. Prepare two source files
Create an assets/ folder at the project root:
assets/
icon-only.png # 1024x1024, no transparency for iOS
icon-foreground.png # 1024x1024, artwork within the centre ~66%
icon-background.png # 1024x1024 solid colour or pattern
splash.png # 2732x2732, logo centred in the middle ~1200px
splash-dark.png # optional dark variant
Keep the logo inside the safe centre. Devices crop splash images differently, and Android's adaptive icons are masked to circles, squircles or rounded squares, so anything near the edge can be clipped.
2. Generate all sizes
npm install -D @capacitor/assets
npx capacitor-assets generate --iconBackgroundColor '#ffffff' --iconBackgroundColorDark '#0b0b0f' --splashBackgroundColor '#ffffff' --splashBackgroundColorDark '#0b0b0f'
The tool writes the iOS asset catalog, Android mipmaps, adaptive icon layers and splash drawables. Commit the generated native files, and rerun the command whenever the brand changes. In CI, run it before cap sync so a stale asset never ships.
3. Android: the system splash screen
Since Android 12 the system draws the splash from your theme: the app icon on a background colour. A fullscreen image is no longer shown by the OS. The Capacitor Splash Screen plugin uses the AndroidX SplashScreen compat library, so configure it in capacitor.config.ts:
plugins: {
SplashScreen: {
launchShowDuration: 0,
launchAutoHide: false,
backgroundColor: '#ffffff',
androidSplashResourceName: 'splash',
showSpinner: false
}
}
Set launchAutoHide: false and hide it yourself so the splash stays until the app is really ready. Do not use a long fixed launchShowDuration, because that makes every launch slower on purpose.
4. Hide it when the UI is ready
import { SplashScreen } from '@capacitor/splash-screen';
async function bootstrap() {
await restoreSession(); // read the token from secure storage
await router.isReady(); // first route resolved
await SplashScreen.hide({ fadeOutDuration: 200 });
}
Keep the work before hide() small and bounded. Add a timeout, for example 3 seconds, so a slow network call can never leave users staring at the splash.
5. Kill the white flash
The flash happens when the native splash disappears but the web view has not painted. Three fixes:
- Set the web view background to match: in
capacitor.config.ts,backgroundColor: '#ffffff'(and a dark value when you support dark mode). - Put the same background on
html, bodyinindex.htmlas inline CSS, so it shows before your bundle loads. - Hide the splash only after the first route renders, as in step 4.
For dark mode, make the inline CSS use prefers-color-scheme so the colour matches the dark splash variant.
6. iOS details
- iOS icons must not contain an alpha channel, or App Store Connect rejects the upload. The generator handles this for
icon-only.png, but check your source. - iOS uses a launch storyboard, not an image set at runtime. Confirm
LaunchScreen.storyboardreferences the generatedSplashimage and the same background colour. - Test on a real device. The simulator caches launch screens aggressively; delete the app and restart to see changes.
7. Checklist before release
- Icon legible at 29pt and 48dp.
- Adaptive icon looks right under circle, squircle and square masks (Android Studio's Image Asset preview shows these).
- Monochrome themed icon layer provided for Android 13+ if you want themed icons.
- Dark mode splash tested.
- Cold start to first paint measured, with the splash hidden by code and not a timer.
- Generated assets regenerated in CI and diffed in the pull request.
Wrapping up
Good launch assets are a one-time setup with a script behind it. If your Ionic app needs a launch, store-readiness or native polish pass, the HybridMob team does this work for Ionic and Capacitor teams every week; get in touch and we will review your build.