Build iOS applications using Xcode for App Store distribution. This comprehensive guide covers iOS project configuration, signing, and building for both Parent and Student apps on macOS.
Ensure your development environment is ready for iOS development:
Required for Xcode and iOS development
Latest version from Mac App Store
Required for App Store distribution ($99/year)
For testing (iOS 12.0+ supported)
# Install Xcode command line tools
sudo xcode-select --install
# Verify installation
xcode-select -p
# Accept Xcode license
sudo xcodebuild -license accept
Configure iOS-specific settings for both Parent and Student apps:
# Open Parent App in Xcode
cd parent_app
open ios/Runner.xcworkspace
# For Student App (in another Xcode instance)
cd ../student_app
open ios/Runner.xcworkspace
Update iOS app configuration in Info.plist files:
<!-- parent_app/ios/Runner/Info.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Mighty School Parent</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>mighty_school_parent</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<!-- Permissions -->
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to capture photos for profile and documents.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photo library access to select images for profile and documents.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for voice messages and calls.</string>
<!-- Network Security -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>your-domain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
</dict>
</dict>
</dict>
</dict>
</plist>
Set up Firebase configuration for push notifications:
GoogleService-Info.plist from Firebase Console// ios/Runner/AppDelegate.swift
import UIKit
import Flutter
import Firebase
import UserNotifications
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Messaging.messaging().apnsToken = deviceToken
}
}
Build iOS applications for testing and distribution:
# Build for iOS Simulator
cd parent_app
flutter build ios --simulator
# Run on simulator
flutter run -d "iPhone 14 Pro"
# Build for connected iOS device
flutter build ios --debug
# Run on connected device
flutter run -d "Your iPhone Name"
# Build release version
flutter build ios --release
# Build with specific configuration
flutter build ios --release --flavor production
Configure code signing for App Store distribution:
# Create certificates using fastlane (optional)
gem install fastlane
# Initialize fastlane in iOS directory
cd ios
fastlane init
# Create certificates and provisioning profiles
fastlane match appstore
Create archives and upload to App Store Connect:
# Build and upload using Flutter
flutter build ipa --release
# Upload using Xcode command line tools
xcrun altool --upload-app --type ios --file build/ios/ipa/*.ipa --username "your-apple-id@email.com" --password "app-specific-password"
Create scripts to automate the iOS build process:
#!/bin/bash
# build_ios_apps.sh
echo "Building Mighty School iOS Apps..."
# Check if running on macOS
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "Error: iOS builds require macOS"
exit 1
fi
# Build Parent App
echo "Building Parent App for iOS..."
cd parent_app
flutter clean
flutter pub get
flutter build ios --release
# Build Student App
echo "Building Student App for iOS..."
cd ../student_app
flutter clean
flutter pub get
flutter build ios --release
echo "iOS builds completed!"
echo "Open Xcode to archive and upload to App Store:"
echo "1. parent_app/ios/Runner.xcworkspace"
echo "2. student_app/ios/Runner.xcworkspace"