Production Build & Deployment Guide

This guide covers compiling, code-signing, and packaging Neon applications for production deployment to the Google Play Store (Android) and the Apple App Store (iOS).


Part 1: Android Production Deployment

Android apps built with Neon are standard Gradle-based Kotlin projects located in the android/ directory.

1. Generate an Android Signing Key

To upload an application to Google Play, it must be signed with an upload key:

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

Keep your keystore file and passwords safe and never commit them to public version control.

2. Configure Signing in Gradle

Create a key.properties file in android/key.properties:

storePassword=YourKeystorePassword
keyPassword=YourKeyPassword
keyAlias=upload
storeFile=/path/to/upload-keystore.jks

Update android/app/build.gradle:

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

3. Build the Release Artifacts

A. Build Release APK:

cd android
./gradlew assembleRelease

The generated APK will be at: android/app/build/outputs/apk/release/app-release.apk

B. Build Android App Bundle (AAB for Google Play):

cd android
./gradlew bundleRelease

The generated bundle will be at: android/app/build/outputs/bundle/release/app-release.aab


Part 2: iOS Production Deployment (macOS)

iOS apps built with Neon are standard Xcode projects located in the NeonApp/ directory.

1. Code Signing & Team Setup

  1. Open NeonApp/NeonApp.xcodeproj in Xcode.
  2. Select the top-level NeonApp project in the Project Navigator.
  3. Select the NeonApp target and navigate to Signing & Capabilities.
  4. Check Automatically manage signing.
  5. Choose your Team associated with your active Apple Developer Account.
  6. Provide your unique Bundle Identifier (e.g. com.company.neonapp).

2. Configure Production Server Endpoints

In production, your native shell connects to your deployed production backend via HTTPS. Ensure Info.plist enforces secure App Transport Security (ATS):

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
</dict>

3. Archive and Distribute to TestFlight & App Store

  1. In Xcode, set the build target device to Any iOS Device (arm64).
  2. In the menu bar, select Product > Archive.
  3. Once the archive completes, the Organizer window opens.
  4. Click Distribute App.
  5. Select App Store Connect for TestFlight internal/external testing or public App Store release.
  6. Follow the on-screen steps to upload the build directly or export an .ipa file for distribution via Apple Transporter.

Part 3: Automated CI/CD (GitHub Actions)

Here is a turnkey GitHub Actions workflow (.github/workflows/deploy.yml) to automatically build and validate Android and iOS releases:

name: Neon App CI/CD

on:
  push:
    branches: [ main ]

jobs:
  build-android:
    name: Build Android Release AAB
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Dart SDK
        uses: dart-lang/setup-dart@v1
        with:
          sdk: stable

      - name: Set up Java 17
        uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '17'

      - name: Install Dart Dependencies
        run: dart pub get

      - name: Build Android Bundle
        run: |
          cd android
          ./gradlew bundleRelease

      - name: Upload Android Artifact
        uses: actions/upload-artifact@v4
        with:
          name: app-release.aab
          path: android/app/build/outputs/bundle/release/app-release.aab

  build-ios:
    name: Validate iOS Build
    runs-on: macos-14
    steps:
      - uses: actions/checkout@v4

      - name: Set up Xcode
        uses: maxim-lobanov/setup-xcode@v1
        with:
          xcode-version: '15.2'

      - name: Build iOS Archive
        run: |
          cd NeonApp
          xcodebuild -project NeonApp.xcodeproj -scheme NeonApp -destination 'generic/platform=iOS' clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO