Skip to content

0xNull-ops/iOS-auto-deploy-and-localization

Repository files navigation

iOS Auto-Deploy and Localization

Automate version bumping, changelog generation, and App Store releases for native iOS projects.

Adapted from flutter-automatic-deploy by Filip Kowalski.

Features

  • Universal version bumping - Works with any iOS project structure (.xcodeproj / .xcworkspace)
  • Auto-changelog generation - Generates changelog from git commits using conventional commits
  • iOS automation - Build IPA, upload to App Store Connect, and auto-submit for review
  • Pre-release validation - Validates localization files before release
  • Git integration - Auto-commit, create tags, and push to remote

Quick Start

1. Clone or download the scripts

git clone https://github.com/your-username/iOS-auto-deploy-and-localization.git
cd iOS-auto-deploy-and-localization
chmod +x ios_version_bump.sh submit_to_app_store.py localization_checker.py

2. Set up your credentials

Option A: Using .env file (Recommended)

# Copy the example file
cp .env.example .env

# Edit .env with your credentials
nano .env

Your .env file should contain:

APP_STORE_API_KEY_ID=YOUR_KEY_ID_HERE
APP_STORE_ISSUER_ID=YOUR_ISSUER_ID_HERE
APP_STORE_P8_KEY_PATH=./keys/AuthKey_YOUR_KEY_ID.p8

Option B: Using shell environment (Alternative)

Add to ~/.zshrc or ~/.bashrc:

export APP_STORE_API_KEY_ID=your_key_id
export APP_STORE_ISSUER_ID=your_issuer_id

3. Add your .p8 authentication key

Place your App Store Connect API key (.p8 file) in the keys/ directory:

keys/AuthKey_YOUR_KEY_ID.p8

⚠️ Important: The .p8 file is a secret! It's already in .gitignore so it won't be committed.

4. Install Python dependencies

pip3 install PyJWT requests cryptography

5. Configure ExportOptions.plist

Edit ExportOptions.plist and replace YOUR_TEAM_ID with your Apple Developer Team ID.

Usage

Basic Version Bumping

# Bump patch version (1.0.0 -> 1.0.1)
./ios_version_bump.sh patch

# Bump minor version (1.0.0 -> 1.1.0)
./ios_version_bump.sh minor

# Bump major version (1.0.0 -> 2.0.0)
./ios_version_bump.sh major

# Bump build number only
./ios_version_bump.sh build

# Set specific version
./ios_version_bump.sh 1.5.0+42

Full Release (Build + Upload + Submit)

# Full release
./ios_version_bump.sh patch --release

# Upload without auto-submitting to App Store review
./ios_version_bump.sh patch --release --skip-submit

Git Integration

# Auto-commit version changes
./ios_version_bump.sh patch --commit

# Create and push git tag
./ios_version_bump.sh patch --push-tag

# Full release with tag push
./ios_version_bump.sh patch --release --push-tag

Preview Mode

# See what would happen without making changes
./ios_version_bump.sh patch --dry-run

Options

Option Description
major Bump major version
minor Bump minor version
patch Bump patch version
build Bump build number only
X.Y.Z+B Set specific version
--release Build and upload after version bump
--skip-submit Skip automatic App Store submission
--commit Auto-commit version changes
--push-tag Create and push git tag
--no-tag Skip git tag creation
--dry-run Preview without modifying files
--scheme=NAME Xcode scheme to build
--config=PATH Path to ExportOptions.plist

Environment Variables

These can be set in .env file or shell environment:

Variable Description Default
APP_STORE_API_KEY_ID App Store Connect API Key ID Required
APP_STORE_ISSUER_ID App Store Connect Issuer ID Required
APP_STORE_P8_KEY_PATH Path to .p8 private key ./keys/AuthKey_{KEY_ID}.p8

Setting Up App Store Connect API

  1. Go to App Store Connect > Users and Access > Keys
  2. Click + to create a new API key
  3. Give it a name and select Admin or App Manager role
  4. Download the .p8 file (you can only download it once!)
  5. Note the Key ID and Issuer ID
  6. Place the .p8 file in the keys/ directory: keys/AuthKey_YOUR_KEY_ID.p8
  7. Copy .env.example to .env and fill in your Key ID and Issuer ID

Creating a Test App in App Store Connect

To test these scripts without publishing:

  1. Go to App Store Connect
  2. Click My Apps > + > New App
  3. Fill in:
    • Platform: iOS
    • Name: Your Test App Name
    • Primary Language: English
    • Bundle ID: Create a new one (e.g., com.yourname.testapp)
    • SKU: Any unique identifier
  4. The app will be in "Prepare for Submission" state
  5. You can upload builds and test the automation without actually submitting

Note: You don't need to fill in all App Store metadata for testing uploads.

Localization Checker

Validate .strings files across localizations:

./localization_checker.py /path/to/ios/project

Changelog Generation

The script generates changelog from git commits using Conventional Commits:

  • feat: → Added
  • fix: → Fixed
  • refactor:, perf:, style:, chore: → Changed

Project Structure

iOS-auto-deploy-and-localization/
├── ios_version_bump.sh      # Main version bump and release script
├── submit_to_app_store.py   # App Store Connect API automation
├── localization_checker.py  # .strings file validator
├── ExportOptions.plist      # Template for IPA export
├── .env.example             # Example environment file (copy to .env)
├── .env                     # Your credentials (git-ignored)
├── keys/                    # Place your .p8 auth key here (git-ignored)
│   └── AuthKey_XXXXX.p8
├── README.md                # This file
└── CHANGELOG.md             # Auto-updated by script

License

MIT License - feel free to use in your projects!

About

iOS Auto-Deploy and Localization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published