This document describes the automated build process for the Simple Gym Tracker application, specifically focusing on generating an iOS IPA for distribution.
To simplify the build process and ensure consistency, a shell script build_ipa.sh is provided in the project root. This script automates several manual steps into a single command.
Before running the build script, ensure you have the following installed and configured on your macOS machine:
- Flutter SDK: Installed and added to your
PATH. - Xcode: Installed with the latest command line tools.
- CocoaPods: Installed (
sudo gem install cocoapods). - iOS Development Certificates: Configured in Xcode for the project.
- Open your terminal.
- Navigate to the project root directory.
- Run the build script:
./build_ipa.shThe build_ipa.sh script performs the following steps in sequence:
- Environment Check: Verifies that
flutterandpodcommands are available. - Clean Build Cache: Runs
flutter cleanto remove any stale build artifacts. - Update Dependencies: Runs
flutter pub getto ensure all Dart packages are up to date. - iOS Pod Reset:
- Navigates to the
ios/directory. - Deletes the
Pods/folder andPodfile.lock. - Runs
pod installto perform a fresh installation of iOS dependencies.
- Navigates to the
- Build IPA: Executes
flutter build ipa --releaseto generate the final application archive and IPA file.
Once the script completes successfully, you can find the build artifacts in the following locations:
- IPA File:
build/ios/ipa/*.ipa(Used for distribution via App Store Connect or Ad-Hoc). - Xcode Archive:
build/ios/archive/Runner.xcarchive(Used for manual uploads or debugging symbols).
- Permissions Error: If you get a "Permission denied" error when running the script, ensure it is executable:
chmod +x build_ipa.sh
- CocoaPods Errors: If
pod installfails, try updating your local pod repository:pod repo update
- Signing Errors: The build might fail if Xcode cannot find a valid signing identity. Open
ios/Runner.xcworkspacein Xcode and verify the "Signing & Capabilities" settings for theRunnertarget.
If you prefer to run commands manually, the standard sequence is:
flutter clean
flutter pub get
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..
flutter build ipa --release