# Setup Fastlane

> Set up Fastlane for iOS/macOS app automation

- **Type:** Skill
- **Install:** `agentstack add skill-greenstevester-fastlane-skill-setup-fastlane`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [greenstevester](https://agentstack.voostack.com/s/greenstevester)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [greenstevester](https://github.com/greenstevester)
- **Source:** https://github.com/greenstevester/fastlane-skill/tree/main/skills/setup-fastlane

## Install

```sh
agentstack add skill-greenstevester-fastlane-skill-setup-fastlane
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## Fastlane Setup (One-Time)

```
┌─────────────────────────────────────────────────────────────────┐
│  ONE-TIME SETUP                                                 │
│  ══════════════                                                 │
│  After this, you'll have:                                       │
│                                                                 │
│    fastlane ios test    → Run tests                             │
│    fastlane ios beta    → Upload to TestFlight                  │
│    fastlane ios release → Submit to App Store                   │
│                                                                 │
│  Do this once per project. Takes ~10 minutes.                   │
└─────────────────────────────────────────────────────────────────┘
```

### Environment Check
- Xcode CLI: !`xcode-select -p 2>/dev/null && echo "✓" || echo "✗ Run: xcode-select --install"`
- Homebrew: !`brew --version 2>/dev/null | head -1 || echo "✗ Run: /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""`
- Fastlane: !`fastlane --version 2>/dev/null | grep -o "fastlane [0-9.]*" | head -1 || echo "✗ Run: brew install fastlane"`

### Your Project
- Project: !`find . -maxdepth 2 -name "*.xcodeproj" 2>/dev/null | head -1 || echo "None found"`
- Workspace: !`find . -maxdepth 2 -name "*.xcworkspace" ! -path "*/.build/*" ! -path "*/xcodeproj/*" 2>/dev/null | head -1 || echo "None"`
- Bundle ID: !`grep -r "PRODUCT_BUNDLE_IDENTIFIER" --include="*.pbxproj" . 2>/dev/null | head -1 | sed 's/.*= //' | tr -d '";' || echo "Not found"`
- Team ID: !`grep -r "DEVELOPMENT_TEAM" --include="*.pbxproj" . 2>/dev/null | head -1 | sed 's/.*= //' | tr -d '";' || echo "Not found"`

### Target: ${ARGUMENTS:-current directory}

---

## Step 1: Install Fastlane

```bash
brew install fastlane
```

> **Why Homebrew?** Bundler 4.x broke Fastlane's Ruby dependencies. Homebrew avoids all version conflicts.

---

## Step 2: Create Configuration Files

### `fastlane/Appfile`
```ruby
app_identifier("{{BUNDLE_ID}}")  # Your bundle ID
apple_id("{{APPLE_ID}}")         # Your Apple ID email
team_id("{{TEAM_ID}}")           # Your team ID
```

### `fastlane/Fastfile`
```ruby
default_platform(:ios)

platform :ios do
  desc "Run tests"
  lane :test do
    scan(scheme: "{{SCHEME}}")
  end

  desc "Upload to TestFlight (internal testers)"
  lane :beta do |options|
    increment_build_number unless options[:skip_build_increment]
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    pilot(skip_waiting_for_build_processing: true)
  end

  desc "Upload to TestFlight and distribute to external testers"
  lane :beta_external do |options|
    increment_build_number
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    pilot(
      distribute_external: true,
      groups: ["External Testers"],
      changelog: options[:changelog] || "Bug fixes and improvements",
      skip_waiting_for_build_processing: false
    )
  end

  desc "Submit the latest TestFlight build for App Store review"
  lane :release do
    deliver(
      build_number: latest_testflight_build_number.to_s,
      submit_for_review: true,
      automatic_release: false,
      force: true,
      skip_binary_upload: true,
      skip_metadata: false,
      skip_screenshots: false
    )
  end

  desc "Build, upload, and submit a fresh build to the App Store"
  lane :release_full do |options|
    increment_version_number(version_number: options[:version]) if options[:version]
    increment_build_number
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    deliver(
      submit_for_review: true,
      automatic_release: options[:auto_release] == true,
      force: true
    )
  end
end
```

Replace `{{SCHEME}}` with your app's scheme name (usually the app name).

---

## Step 3: Set Up Metadata (Optional)

Download your existing App Store listing:
```bash
fastlane deliver download_metadata
fastlane deliver download_screenshots
```

This creates `fastlane/metadata/` with editable text files for your app description, keywords, etc.

---

## You're Done!

```bash
# Verify setup
fastlane lanes

# Run your first lane
fastlane ios test
```

### Quick Reference
| Command | What it does |
|---------|--------------|
| `fastlane ios test` | Run tests |
| `fastlane ios beta` | Build + TestFlight |
| `fastlane ios release` | Build + App Store |
| `fastlane deliver download_metadata` | Fetch App Store listing |

---

## Next Steps

- **Code signing issues?** Ask: "Set up Match for code signing"
- **Need screenshots?** Ask: "Automate my App Store screenshots"
- **CI/CD setup?** See [Xcode Cloud guide](../../docs/xcode-cloud.md)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [greenstevester](https://github.com/greenstevester)
- **Source:** [greenstevester/fastlane-skill](https://github.com/greenstevester/fastlane-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-greenstevester-fastlane-skill-setup-fastlane
- Seller: https://agentstack.voostack.com/s/greenstevester
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
