A simple, clean template for building iOS, iPadOS, and macOS applications with Mac Catalyst support. This template includes GitHub Actions CI/CD, Fastlane automation, and Dependabot for dependency management.
- ✅ iOS/iPadOS app support
- ✅ macOS app support
- ✅ Mac Catalyst support (iOS app running on macOS)
- ✅ SwiftUI-based architecture
- ✅ GitHub Actions CI/CD pipeline
- ✅ Fastlane automation for builds and deployments
- ✅ Dependabot for automated dependency updates
- ✅ Xcode 15+ compatible
- ✅ Simple, readable code structure
Copy .env.template to .env and update with your project details:
cp .env.template .envThen edit .env:
# Project Configuration
PROJECT_NAME=YourAppName
DISPLAY_NAME=Your App Name
PRODUCT_BUNDLE_IDENTIFIER=com.yourcompany.yourapp
ORGANIZATION_NAME=Your Company Name
ORGANIZATION_IDENTIFIER=com.yourcompany
COPYRIGHT=Copyright © 2024 Your Company Name. All rights reserved.
# Development Team (Apple Developer)
DEVELOPMENT_TEAM=ABCD123456
# App Store Connect API
APP_STORE_CONNECT_KEY_ID=ABC123DEF4
APP_STORE_CONNECT_ISSUER_ID=12345678-1234-1234-1234-123456789012
# Deployment Targets
IOS_DEPLOYMENT_TARGET=15.0
MACOS_DEPLOYMENT_TARGET=12.0
SWIFT_VERSION=5.0
# GitHub Repository
GITHUB_REPOSITORY_OWNER=yourusername
GITHUB_REPOSITORY_NAME=yourapp
# Fastlane Configuration
APPLE_ID=your-apple-id@example.com
FASTLANE_APP_IDENTIFIER=com.yourcompany.yourapp
FASTLANE_SCHEME=YourAppName
# Fastlane Match (Code Signing)
MATCH_GIT_URL=git@github.com:yourusername/yourapp-certificates.git
MATCH_PASSWORD=your_match_repository_passphraseImportant: Add .env to your .gitignore file to keep your secrets safe!
After updating the config, rename the following:
MyApp.xcodeproj→YourAppName.xcodeprojMyApp/folder →YourAppName/- Update project name in Xcode
Create a private repository for your certificates:
# Create a new private repository (replace with your details)
gh repo create yourapp-certificates --private
# Initialize match (will create certificates repository)
fastlane match initAutomated Setup (Recommended):
After configuring your .env file, run the automated GitHub setup:
# Make sure you're authenticated with GitHub CLI
gh auth login
# Run the automated setup script
./github-setup.shThis script will automatically:
- Import all non-sensitive variables as GitHub Variables
- Import sensitive data as GitHub Secrets
- Skip placeholder/template values
- Provide instructions for manual steps
Manual Setup:
Alternatively, set up manually in your GitHub repository (Settings → Secrets and Variables → Actions):
DEVELOPMENT_TEAM: Your Apple Developer Team IDAPP_STORE_CONNECT_KEY_ID: App Store Connect API Key IDAPP_STORE_CONNECT_ISSUER_ID: App Store Connect Issuer IDAPP_STORE_CONNECT_PRIVATE_KEY: App Store Connect API Private Key (the .p8 file content)APPLE_ID: Your Apple ID emailMATCH_PASSWORD: Passphrase for your match certificates repositoryMATCH_GIT_URL: Git URL for your certificates repository
PROJECT_NAME: Your app namePRODUCT_BUNDLE_IDENTIFIER: Your bundle IDIOS_DEPLOYMENT_TARGET: Minimum iOS versionMACOS_DEPLOYMENT_TARGET: Minimum macOS versionSWIFT_VERSION: Swift language versionCOPYRIGHT: Copyright noticeORGANIZATION_NAME: Your organization nameFASTLANE_APP_IDENTIFIER: App identifier for FastlaneFASTLANE_SCHEME: Xcode scheme name
# Install Ruby dependencies
bundle install
# Install Fastlane (if not using bundle)
gem install fastlane
# Initialize Fastlane (optional, already configured)
fastlane init# Sync certificates and profiles
fastlane ios certificates
fastlane mac certificates
# Build iOS app
fastlane ios build
# Build macOS app
fastlane mac build
# Run tests
fastlane ios test
fastlane mac test# Deploy to TestFlight
fastlane ios beta
fastlane mac beta
# Deploy to App Store
fastlane ios release
fastlane mac releaseThe template includes two workflows:
- CI Pipeline (
ci.yml): Runs on every push/PR, builds all platforms and runs tests - Release Pipeline (
release.yml): Runs on version tags, builds and deploys to App Store
To trigger a release:
git tag v1.0.0
git push origin v1.0.0├── MyApp.xcodeproj/ # Xcode project
├── MyApp/
│ ├── Shared/ # Shared code (iOS/macOS)
│ │ ├── App.swift # Main app entry point
│ │ ├── ContentView.swift # Main view
│ │ └── Assets.xcassets/ # Images and assets
│ ├── iOS/ # iOS-specific code
│ └── macOS/ # macOS-specific code
│ └── MyApp.entitlements # macOS app entitlements
├── fastlane/
│ ├── Fastfile # Fastlane automation
│ ├── Appfile # App configuration
│ └── Matchfile # Fastlane Match configuration
├── .github/
│ ├── workflows/
│ │ ├── ci.yml # CI pipeline
│ │ └── release.yml # Release pipeline
│ └── dependabot.yml # Dependency updates
├── .env.template # Template for environment variables
├── .env # Your environment variables (create from template)
├── setup.sh # Project setup automation
├── github-setup.sh # GitHub secrets/variables automation
├── verify.sh # Template verification script
├── Gemfile # Ruby dependencies
├── .swiftlint.yml # SwiftLint configuration
├── .gitignore # Git ignore rules
└── LICENSE # MIT License
For Swift Package Manager dependencies:
- Open Xcode
- Go to File → Add Package Dependencies
- Add your package URL
For CocoaPods dependencies:
- Create a
Podfilein the root directory - Add your pods
- Run
bundle exec pod install
- Shared code: Place in
MyApp/Shared/ - iOS-only code: Place in
MyApp/iOS/ - macOS-only code: Place in
MyApp/macOS/
Use #if os(iOS) or #if os(macOS) for conditional compilation within shared files.
The project is configured to support Mac Catalyst. To customize the Mac Catalyst experience:
- Use
#if targetEnvironment(macCatalyst)for Mac Catalyst-specific code - Configure Mac Catalyst settings in Xcode under target settings
- Build fails with signing errors: Make sure
DEVELOPMENT_TEAMis set correctly - Fastlane authentication fails: Verify App Store Connect API credentials
- GitHub Actions fail: Check that all required secrets are set
- Check the GitHub Issues for common problems
- Review Apple's documentation for iOS/macOS development
- Consult Fastlane documentation for deployment issues
This template is available under the MIT License. Replace this section with your app's license.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Note: This template is designed to be simple and straightforward. For more complex needs, consider adding additional tools like SwiftLint, SwiftFormat, or custom build scripts.