Skip to content
Tutorials Center
My learning

Topics

Lesson 61 of 73 ยท Publishing

Publishing to Google Play and the App Store

Sign and ship a Flutter app: Android keystores and app bundles, Xcode archives, store listings, review pitfalls and a release checklist.

A working app on your phone is not yet an app in the stores. Publishing means signing the build so the stores know it is really yours, packaging it in the format each store expects, filling in a store listing, and passing a review. None of this is hard, but the details are unforgiving: a lost signing key or a missing privacy policy can cost days.

This lesson walks through the whole path for Google Play and the Apple App Store, with a release checklist at the end. It assumes you know how to produce flavors and version numbers. Automating all of it is the topic of CI/CD and Releases.

Real vs stand-in. The commands, Gradle and Xcode steps are real and read-only: publishing needs developer accounts and signing keys that no website can provide. The live examples are JavaScript stand-ins that check a release checklist and compare store limits. Store rules change often, so confirm current requirements in the Play Console and App Store Connect.

From code to a store

Sign Prove the build is yours.
Package AAB for Google, IPA for Apple.
List Name, screenshots, privacy.
Review The store checks your app.
1 / 2

Android: signing and the app bundle

Every Android release is signed with a private key stored in a keystore file. Create an upload key once:

Terminal
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Keep the file and its passwords backed up somewhere safe, and never commit them. Put the details in android/key.properties (also not committed):

PROPERTIES
storePassword=your-store-password
keyPassword=your-key-password
keyAlias=upload
storeFile=/Users/you/upload-keystore.jks

Then load them in android/app/build.gradle.kts and attach a signing config to the release build type:

Kotlin
val keystoreProperties = java.util.Properties().apply {
    val file = rootProject.file("key.properties")
    if (file.exists()) load(file.inputStream())
}

android {
    signingConfigs {
        create("release") {
            keyAlias = keystoreProperties["keyAlias"] as String?
            keyPassword = keystoreProperties["keyPassword"] as String?
            storeFile = keystoreProperties["storeFile"]?.let { file(it as String) }
            storePassword = keystoreProperties["storePassword"] as String?
        }
    }
    buildTypes {
        release { signingConfig = signingConfigs.getByName("release") }
    }
}

Build the Android App Bundle, the format Google Play requires for new apps:

Terminal
flutter build appbundle --release --flavor prod -t lib/main_prod.dart

The file appears under build/app/outputs/bundle/prodRelease/. Google Play then generates optimized APKs for each device from it. Enroll in Play App Signing: Google keeps the final app signing key and you only hold the upload key, so if you lose the upload key you can ask Google to reset it. Without Play App Signing, a lost key means you can never update that app again.

Do not forget the basics in android/app/src/main/AndroidManifest.xml: a proper android:label, only the permissions you really use, and a launcher icon. Also keep an eye on the target API level requirement, which Google raises every year; new uploads must meet the current minimum.

iOS: archive and upload

For iOS you need a paid Apple Developer Program membership and a Mac. The steps:

  1. In App Store Connect create the app record with its bundle id (for example com.example.shop).
  2. In Xcode open ios/Runner.xcworkspace, select the Runner target, and under Signing & Capabilities choose your team. "Automatically manage signing" is the easy route.
  3. Set the version and build number (Flutter fills them from pubspec.yaml).
  4. Build the release:
Terminal
flutter build ipa --release --flavor prod -t lib/main_prod.dart
  1. Upload: open the .xcarchive in Xcode's Organizer and choose Distribute App, or use the command line:
Terminal
xcrun altool --upload-app --type ios -f build/ios/ipa/shop.ipa --apiKey KEY_ID --apiIssuer ISSUER_ID

(Apple also offers the Transporter app and the newer xcrun notarytool is for macOS notarization, a different job.) After processing, the build shows up in TestFlight, Apple's beta system, where internal testers can install it within minutes.

The store listing

Both stores need the same ingredients, in slightly different shapes:

  • Name, short and full description, written for people, with honest keywords.
  • Screenshots for the required device sizes, and an optional preview video.
  • App icon and, on Google Play, a 1024 by 500 feature graphic.
  • Privacy policy URL, always required if you collect any data.
  • Data disclosure: the Data safety form on Google Play, the App Privacy "nutrition label" on Apple. Answer for everything your app and its SDKs (analytics, ads, crash reporting) collect.
  • Age rating, category, and contact information.
  • Test account credentials if your app has a login, so reviewers can get past it.

Testing tracks and staged release

Do not go straight to production.

  • Google Play: internal testing (instant, up to 100 testers), closed testing, open testing, then production. New personal developer accounts have additionally had to run a closed test with a minimum number of testers for a minimum period before they can apply for production, so plan for that wait and check the current rule.
  • Apple: TestFlight internal and external testing, then submission for review. External beta builds go through a light review too.

When you release, use a percentage rollout on Google Play and a phased release on Apple so a bad bug hits few users. More in CI/CD and Releases.

Review pitfalls

Most rejections are boring and avoidable:

  • Crashes or broken links during review. Test the exact release build, not the debug build.
  • Missing or wrong privacy information, or a policy that does not match what the app does.
  • Login with no demo account, so reviewers cannot see the app.
  • Incomplete features, "coming soon" screens and placeholder text.
  • Payments: digital goods and subscriptions generally must use the store's own billing. Physical goods and services can use other providers.
  • Unused permissions and unexplained permission prompts. Explain why you need the camera before the system prompt appears.
  • Web wrapper apps with little native value can be rejected by Apple.
  • Metadata that misleads: screenshots not showing the real app, or names stuffed with keywords.

If you get rejected, read the reviewer's note carefully, fix the issue and resubmit with a short reply. Appeals exist but fixing is usually faster.

Stand-in: a release checklist

This tiny program models a checklist where every item has a check function, so the release can only go ahead when all blockers pass.

JS A release checklist that blocks bad builds

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Stand-in: rollout planning

JS How many users does a staged rollout expose?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Release checklist

  1. Version name and a higher build number set.
  2. Release build tested on real devices, with the production config.
  3. Keystore and passwords backed up; Play App Signing on.
  4. Store listing, screenshots, privacy policy and data disclosures complete.
  5. Demo account added to the review notes.
  6. Crash reporting and analytics working in the release build.
  7. Staged rollout planned, with someone watching crash reports.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which file format does Google Play require for new apps?

    Play takes an app bundle and generates device-specific APKs from it.
  2. 2. What is the benefit of Play App Signing?

    You still sign uploads with an upload key, but losing it is no longer fatal.
  3. 3. Which is a common reason for an app review rejection?

    Reviewers must be able to reach every feature. Provide test credentials in the review notes.
  4. 4. Why use a percentage rollout?

    Exposing the release gradually limits the damage of a bad build while you watch crash reports.

Summary

  • Sign Android releases with an upload key (never committed) and use Play App Signing.
  • Build flutter build appbundle for Google and flutter build ipa for Apple, then upload with the console, Xcode or command-line tools.
  • Store listings need screenshots, a privacy policy, data disclosures and, for logins, a demo account.
  • Test through internal and beta tracks, then release in stages.
  • Most rejections come from crashes, privacy mismatches and unreachable features, so test the exact release build.

Next: CI/CD and Releases