<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Huseyin Iyibas on Medium]]></title>
        <description><![CDATA[Stories by Huseyin Iyibas on Medium]]></description>
        <link>https://medium.com/@iyibash?source=rss-5dcbe7ac0ad4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ymYyD3si1MyqxZ3Q2bX-nQ.png</url>
            <title>Stories by Huseyin Iyibas on Medium</title>
            <link>https://medium.com/@iyibash?source=rss-5dcbe7ac0ad4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:47:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iyibash/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Built a Mobile Release Pipeline for a Multi-App iOS Team (From Zero)]]></title>
            <link>https://iyibash.medium.com/how-i-built-a-mobile-release-pipeline-for-a-multi-app-ios-team-from-zero-289022822b10?source=rss-5dcbe7ac0ad4------2</link>
            <guid isPermaLink="false">https://medium.com/p/289022822b10</guid>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[firebase-app-distribution]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[circleci]]></category>
            <category><![CDATA[xcode-cloud]]></category>
            <dc:creator><![CDATA[Huseyin Iyibas]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 23:41:55 GMT</pubDate>
            <atom:updated>2026-07-22T23:41:55.941Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>“Hey Claude/Cursor/Codex, make me a CI/CD pipeline. Make no mistakes.”</em></blockquote><blockquote>I wish it were that easy. If it were, you probably wouldn’t need me, and you definitely wouldn’t be reading this.</blockquote><p><em>Prefer reading on X (Twitter)? </em><a href="https://x.com/iyibash/status/2078131760156623179">https://x.com/iyibash/status/2078131760156623179</a></p><p>When I joined a consumer iOS team that shipped several apps from one organization, there was no shared signing process. Certificates were manually exported. Provisioning profiles were passed around in chat. Code signing lived in one engineer’s Keychain. New laptop setup was unpredictable.</p><p>Over the next months I rebuilt the signing foundation so the whole team could ship without me in the loop:</p><ul><li><strong>Certificates and profiles</strong> → <strong>Fastlane Match</strong> + dedicated private repo (release owner)</li><li><strong>Developer onboarding</strong> → clone repo, automatic signing in Xcode, start coding</li><li><strong>CI usage</strong> → bundle install + Fastlane only on CircleCI, never on every laptop</li></ul><p>This article is what I wish existed when I started: not “what is Fastlane,” but a practical signing setup you can adapt for your own team from day zero.</p><h3>What we were optimizing for</h3><p>Before picking tools, we wrote down constraints:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jfu6SiAtKnRtHqzVHDPpA.png" /></figure><p>We <strong>did not</strong> put everything in one pipeline. Splitting <strong>internal</strong> vs <strong>production</strong> saved us when CircleCI config changed or when Apple’s upload APIs acted up.</p><p><strong>Rule of thumb we used:</strong></p><ul><li>CircleCI is tag-triggered only. Push/merge does not trigger packaging by itself.</li><li>t* tags ship to Firebase App Distribution.</li><li>a* tags ship to App Store Connect testers (not public App Store release).</li><li>You can technically create t* / a* tags from any branch.</li></ul><h3>Tag format convention</h3><p>We used semantic app version + distribution channel + package counter:</p><ul><li>t2.5.2.x for Firebase/App Distribution packages</li><li>a2.5.2.x for App Store Connect tester packages</li></ul><p>x starts at 0 and increments for each package generated for that same app version.<br>This gave us two wins: strict traceability and a simple answer to “how many builds did we cut for 2.5.2?”</p><h3>Prerequisites</h3><p>You’ll need:</p><ol><li><strong>Apple Developer Program</strong> (Admin or App Manager for signing assets)</li><li><strong>GitHub / GitLab</strong> repo with your Xcode project</li><li><strong>CircleCI</strong> account connected to the repo</li><li><strong>Firebase project</strong> with iOS apps registered (one Firebase app per bundle ID)</li><li><strong>Gemfile in the repo</strong> so CI can pin Fastlane, plugins, and CocoaPods versions</li><li><strong>Xcode automatic signing</strong> for developers during local development</li></ol><p>Regular developers do <strong>not</strong> install Fastlane, Bundler, or run bundle install.<br>That work stays in CircleCI. The only person who touches signing automation locally is whoever owns release infrastructure.</p><p>Commit a Gemfile like this (from a real production app):</p><pre>source &quot;https://rubygems.org&quot;<br>ruby &quot;3.2.2&quot;gem &quot;abbrev&quot;<br><br>gem &quot;mutex_m&quot;<br>gem &quot;ostruct&quot;<br>gem &quot;fastlane&quot;<br>gem &quot;fastlane-plugin-firebase_app_distribution&quot;<br>gem &quot;cocoapods&quot;, &quot;&gt;= 1.15.0&quot;</pre><p>CircleCI runs bundle install and bundle exec fastlane on every tagged build.<br>Gemfile.lock is generated and committed from the CI/release setup path, not from every developer laptop.</p><h3>Step 1 — Repository layout</h3><p>We kept CI config next to the app, not in a separate infra repo:</p><pre>MyApp/<br>├── MyApp.xcodeproj<br>├── MyApp/<br>├── fastlane/<br>│   ├── Appfile<br>│   ├── Fastfile<br>│   ├── Matchfile<br>│   ├── Pluginfile<br>│   └── ci.xcconfig<br>├── ci_scripts/<br>│   ├── ci_post_clone.sh<br>│   ├── ci_pre_xcodebuild.sh<br>│   └── ci_post_xcodebuild.sh<br>├── .circleci/<br>│   └── config.yml<br>├── Gemfile<br>└── Gemfile.lock</pre><ul><li>fastlane/ is used by <strong>CircleCI</strong> for tagged Firebase distribution (t* tags).</li><li>ci_scripts/ is used by <strong>Xcode Cloud</strong> for release workflows (a* tags).<br>ci_post_clone.sh installs CocoaPods; other hook files can exist per project needs.</li></ul><p>For <strong>multiple apps in one monorepo</strong>, duplicate lanes per scheme or use env vars.<br>Details: One Codebase, Two iOS Apps (coming soon).</p><h3>Step 2 — fastlane/ folder</h3><p>Create a fastlane/ directory at repo root with these files.<br>Placeholders like {{ APPLE_ID_EMAIL }} are for this article; use real values in your private repo.</p><h3>Appfile</h3><pre>app_identifier(&quot;{{ APP_BUNDLE_ID }}&quot;)<br>apple_id(&quot;{{ APPLE_ID_EMAIL }}&quot;)<br>itc_team_id(&quot;{{ APP_STORE_CONNECT_TEAM_ID }}&quot;) # App Store Connect Team ID<br>team_id(&quot;{{ DEVELOPER_PORTAL_TEAM_ID }}&quot;)      # Apple Developer Team ID</pre><h4>Where do itc_team_id and team_id come from?</h4><p>They are <strong>not the same value</strong>. Do not copy one into the other.</p><p>Appfile field</p><p>Name</p><p>Where to find it (reliable)</p><p>team_id</p><p><strong>Developer Portal Team ID</strong></p><p><a href="https://developer.apple.com/account">developer.apple.com/account</a> → <strong>Membership details</strong> → <strong>Team ID</strong></p><p>itc_team_id</p><p><strong>App Store Connect Team ID</strong></p><p>See methods below (usually <strong>not</strong> visible on Users and Access → People)</p><p><strong>Fast mental model:</strong></p><ul><li>team_id → certificates, provisioning profiles, Match, Developer Portal</li><li>itc_team_id → App Store Connect, TestFlight, ASC tester uploads</li></ul><h4>How to find itc_team_id (App Store Connect)</h4><p>The <strong>People</strong> tab often shows users/roles only, without Team ID.</p><p><strong>Format note (this is normal):</strong></p><ul><li>itc_team_id is usually <strong>numeric</strong> (example: 123456789)</li><li>team_id is usually <strong>10-character alphanumeric</strong> (example: ZUC749WF22)</li></ul><p>If JSON shows only numbers for contentProviderId, that is the correct App Store Connect Team ID.</p><p><strong>Method A — ASC JSON endpoint (logged in):</strong></p><ol><li>Log in to <a href="https://appstoreconnect.apple.com/">App Store Connect</a></li><li>Open in the same browser session:</li><li><a href="https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail">https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail</a></li><li>Find your org in data.associatedAccounts</li><li>Copy numeric contentProvider.contentProviderId into itc_team_id</li></ol><p>Example snippet:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;associatedAccounts&quot;: [<br>      {<br>        &quot;contentProvider&quot;: {<br>          &quot;contentProviderId&quot;: 123456789,<br>          &quot;contentProviderPublicId&quot;: &quot;AB12CD34EF&quot;,<br>          &quot;name&quot;: &quot;YOUR_ORG_NAME&quot;<br>        }<br>      }<br>    ]<br>  }<br>}</pre><pre>itc_team_id(&quot;123456789&quot;) # numeric contentProviderId (expected)</pre><p>Use contentProvider.name to pick the correct organization when multiple accounts exist.</p><p><strong>Method B — Fastlane terminal output:</strong></p><pre>bundle exec fastlane match adhoc</pre><p>If team selection is needed, Fastlane prints App Store Connect team names + numeric IDs.</p><p><strong>Method C — single-team shortcut:</strong></p><p>If you are in only one App Store Connect team, omit itc_team_id.</p><p><strong>Optional alternative:</strong> itc_team_name(&quot;YOUR_ORG_NAME&quot;) also works if you prefer name-based selection.</p><h4>How to find team_id (Developer Portal)</h4><ol><li><a href="https://developer.apple.com/account">developer.apple.com/account</a> → <strong>Membership details</strong> → <strong>Team ID</strong></li><li>Or Xcode → <strong>Settings</strong> → <strong>Accounts</strong> → select Team → Team ID</li></ol><p>See <a href="https://medium.com/02-fastlane-match-cert-repo-setup.md">Article #2</a> for the full Appfile + Matchfile setup walkthrough.</p><h3>Matchfile</h3><pre>git_url(https://medium.com/&quot;%7B%7B%20MATCH_CERTIFICATES_GIT_URL%20%7D%7D&quot;)<br>storage_mode(&quot;git&quot;)<br>app_identifier(&quot;{{ APP_BUNDLE_ID }}&quot;)<br>readonly(false)<br>username(&quot;{{ APPLE_ID_EMAIL }}&quot;)</pre><p>readonly(false) is for the release owner when renewing signing assets.<br>CI lanes should run Match in read-only mode during packaging.</p><h3>Pluginfile</h3><pre># Autogenerated by fastlane<br>#<br># Ensure this file is checked in to source control!<br><br>gem &#39;fastlane-plugin-firebase_app_distribution&#39;</pre><h3>ci.xcconfig</h3><p>Manual signing values for CI archive/export:</p><pre>CODE_SIGN_STYLE = Manual<br>DEVELOPMENT_TEAM = {{ DEVELOPER_PORTAL_TEAM_ID }}<br>CODE_SIGN_IDENTITY = Apple Distribution<br>PROVISIONING_PROFILE_SPECIFIER = match AdHoc {{ APP_BUNDLE_ID }}<br>CODE_SIGNING_ALLOWED = NO<br>CODE_SIGN_IDENTITY =</pre><h3>Step 3 — Fastfile for Firebase App Distribution</h3><p>In our setup, this lane is triggered by t* tags (for example t2.5.2.0).</p><p>fastlane/Fastfile:</p><pre>default_platform(:ios)<br>platform :ios do<br>  before_all do<br>    setup_circle_ci<br>  end<br>  lane :upload do |options|<br>      upload_to_firebase<br>  end<br>end<br>def upload_to_firebase<br>    increment_build_number(<br>      build_number: &quot;$CIRCLE_BUILD_NUM&quot;<br>    )<br>    match(type: &quot;adhoc&quot;)<br>    gym(<br>        scheme: &quot;{{ APP_SCHEME }}&quot;,<br>        xcconfig: &quot;./fastlane/ci.xcconfig&quot;,<br>        export_options: {<br>          method: &quot;ad-hoc&quot;,<br>          provisioningProfiles: {<br>            &quot;{{ APP_BUNDLE_ID }}&quot; =&gt; &quot;match AdHoc {{ APP_BUNDLE_ID }}&quot;<br>          },<br>          signingStyle: &quot;manual&quot;,<br>          teamID: &quot;{{ DEVELOPER_PORTAL_TEAM_ID }}&quot;<br>        },<br>        xcargs: [<br>          &quot;-skipPackagePluginValidation&quot;,<br>          &quot;DISABLE_SANDBOX_FOR_BUILD_TOOL_PLUGINS=YES&quot;<br>        ].join(&quot; &quot;),<br>        xcodebuild_formatter: &quot;&quot;<br>    )<br>    firebase_app_distribution(<br>      app: &quot;{{ FIREBASE_APP_ID }}&quot;,<br>      groups: &quot;testers&quot;,<br>      release_notes: &quot;Lots of amazing new features to test out!&quot;,<br>      service_credentials_file: ENV[&quot;FIREBASE_CREDENTIALS_PATH&quot;]<br>    )<br>end</pre><p><strong>Where does</strong> app: &quot;{{ FIREBASE_APP_ID }}&quot; <strong>come from?</strong></p><p>Use the value of GOOGLE_APP_ID from your project&#39;s GoogleService-Info.plist:</p><pre>&lt;key&gt;GOOGLE_APP_ID&lt;/key&gt;<br>&lt;string&gt;1:284960396196:ios:fd62d736449a530e64e731&lt;/string&gt;</pre><p>That string is the Firebase iOS app id for App Distribution uploads.<br>Copy it into firebase_app_distribution(app: &quot;...&quot;) in Fastfile.</p><p>The Firebase plugin is already declared in Gemfile (fastlane-plugin-firebase_app_distribution).<br>No per-developer add_plugin step is required.</p><p>Firebase upload auth is handled in CI via service account JSON (details in Step 7).</p><h3>Validate before tagging (release owner only)</h3><p>Only the release owner dry-runs this lane locally before cutting a t* tag:</p><pre>bundle exec fastlane upload</pre><p>If this fails on the release owner machine, CI will fail too. Regular developers never run this.</p><h3>Step 4 — ci_scripts/ for Xcode Cloud</h3><p>These scripts live at repo root in ci_scripts/ and are picked up automatically by Xcode Cloud.</p><p>We keep ci_pre_xcodebuild.sh and ci_post_xcodebuild.sh in the folder when a project needs extra hooks, but this article only documents the shared baseline: CocoaPods install after clone.</p><p>For the full pattern where pre/post hooks are fetched from one remote source across all repos, see Centralized Xcode Cloud Hooks (coming soon).</p><h3>ci_post_clone.sh</h3><p>Runs after clone and installs CocoaPods dependencies:</p><pre>#!/bin/sh<br>set -e<br>REPO_ROOT=&quot;${CI_PRIMARY_REPOSITORY_PATH:-$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)}&quot;<br>cd &quot;$REPO_ROOT&quot;<br>echo &quot;📦 Installing CocoaPods dependencies in $REPO_ROOT&quot;<br>if ! command -v pod &gt;/dev/null 2&gt;&amp;1; then<br>    echo &quot;❌ CocoaPods (pod) not found in PATH&quot;<br>    exit 1<br>fi<br>pod install<br>echo &quot;✅ CocoaPods installation completed&quot;</pre><h3>Step 5 — CircleCI project setup + workflow</h3><h3>5a. Create the CircleCI project (UI walkthrough)</h3><ol><li>CircleCI → <strong>New project</strong></li><li>Choose <strong>Build, test, and deploy your software application</strong></li><li>Give the project a <strong>unique name</strong> (one per app)</li><li>Click <strong>Next: Set up a pipeline</strong></li><li>For <strong>What would you like to name your project’s first pipeline?</strong> keep the default: build-and-test</li></ol><p><strong>Before selecting the repo:</strong></p><ul><li>Push your CI/CD files to the app repo first (.circleci/config.yml, fastlane/, Gemfile, etc.)</li><li>CircleCI needs those files in git before setup is meaningful</li></ul><p><strong>Connect Git provider:</strong></p><ul><li>CircleCI may ask for a <strong>Personal Access Token (PAT)</strong> from your Git host (GitLab/GitHub)</li><li>Create PAT in your Git provider with repo read access</li><li><strong>Save the PAT in your password manager</strong> — you will need it again for every new CircleCI project</li></ul><p><strong>Select the correct repo:</strong></p><ul><li>Choose the <strong>app repository</strong> (for example carwidget)</li><li>Do <strong>not</strong> select the certificates repo used by Match</li></ul><p>After project creation, CircleCI usually auto-creates a <strong>Pipeline</strong> and <strong>Trigger</strong>.<br>In practice, that auto-setup can be unstable. I often delete both and recreate them manually with default names.</p><p><strong>Pipeline / Trigger order matters:</strong></p><ul><li>To delete a pipeline, delete its trigger first</li><li>To add a trigger, create/select a pipeline first (trigger setup asks which pipeline to run)</li></ul><h3>5b. Environment variables</h3><p>Go to <strong>Project Settings → Environment Variables</strong>.</p><p>If you already configured another app, use <strong>Import variables</strong> from that project.<br>Most values are reusable and this saves a lot of time. It also makes it easier to track what is already set vs missing.</p><p>For a brand-new project, add at minimum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CcvTnbe8NFStqX4MBl0znw.png" /></figure><p><strong>Encode Firebase service account JSON before adding it:</strong></p><pre>base64 -i &quot;/path/to/service-account.json&quot; | tr -d &#39;\n&#39;</pre><ul><li>tr -d &#39;\n&#39; removes newline characters so CircleCI gets one single-line value</li><li>This is <strong>not</strong> language/Turkish-specific; change only if your shell/locale needs different filtering</li><li>Copy the full output as one line into FIREBASE_SERVICE_ACCOUNT_JSON</li></ul><blockquote><strong><em>⚠️ The</em></strong><em> </em><em>% </em><strong><em>at the end is not part of the value.</em></strong><em> When the output has no trailing newline, zsh prints a reverse-video </em><em>% as an end-of-line marker. If the value looks like </em><em>...aWNlIn0=%, the real value ends at </em><em>=. Do </em><strong><em>not</em></strong><em> &quot;clean up&quot; </em><em>=% by deleting both characters: the </em><em>= is base64 padding, and removing it corrupts the value. The build then fails much later, at Firebase upload, with </em><em>Missing authentication credentials, which looks completely unrelated. Safer habit: pipe to </em><em>pbcopy instead of copying from the terminal.</em></blockquote><p><strong>SSH keys (generate once, reuse everywhere):</strong></p><p>CircleCI can auto-generate SSH keys when you add a project. That is convenient, but it also creates drift: two unrelated keys in one project, or a different key per app.</p><p>What we do instead:</p><ol><li><strong>Generate one canonical deploy key on your machine</strong> (or in a secure internal runbook), tied to the same GitLab account that owns repo access:</li></ol><pre>ssh-keygen -t ed25519 -C &quot;circleci-ios-deploy&quot; -f ~/.ssh/circleci_ios_deploy -N &quot;&quot;</pre><p>2.<strong> Add the public key</strong> (circleci_ios_deploy.pub) to GitLab:</p><ul><li>Project deploy key (read-only), or</li><li>Your user SSH keys (if you prefer one user key for all private repos)</li></ul><p>3.<strong> Store the private key securely</strong> (password manager / secrets vault). You will reuse it when:</p><ul><li>Adding SSH keys in CircleCI project settings</li><li>Cloning private repos over git@... (for example Match certificates repo)</li></ul><p>4. In CircleCI → Project Settings → SSH keys, <strong>keep one key</strong> (same suffix as your other iOS projects). Delete unrelated auto-generated keys before adding yours.</p><p><strong>Important:</strong> SSH keys help <strong>SSH git URLs</strong> (git@gitlab...). They do <strong>not</strong> authenticate <strong>HTTPS SPM package URLs</strong> like <a href="https://gitlab.../libraries/foo.">https://gitlab.../libraries/foo.</a></p><p><strong>GitLab HTTPS credentials (</strong>GITLAB_USER <strong>/</strong> GITLAB_PASSWORD<strong>):</strong></p><p>These env vars are for scripts that explicitly use them (for example git clone https://... in Fastlane/Match steps).<br>Xcode SPM does <strong>not</strong> read them automatically.</p><p>If your app depends on private Swift packages over HTTPS, add a pre-build git auth step in CI (see troubleshooting below).</p><h3>5c. .circleci/config.yml</h3><pre>version: 2.1<br>orbs:<br>  macos: circleci/macos@5<br>jobs:<br>  ios-upload:<br>    macos:<br>      xcode: &quot;16.2.0&quot;<br>    resource_class: macos.m1.medium.gen1<br>    environment:<br>      FL_OUTPUT_SKIP_UPDATE_CHECK: &quot;true&quot;<br>      FL_BUILDLOG_PATH: ~/Library/Logs/fastlane<br>    steps:<br>      - checkout<br>      - restore_cache:<br>          keys:<br>            - gems-{{ checksum &quot;Gemfile.lock&quot; }}<br>      - run:<br>          name: Install Ruby dependencies<br>          command: |<br>            bundle config set path vendor/bundle<br>            bundle install --jobs=4 --retry=3<br>      - save_cache:<br>          key: gems-{{ checksum &quot;Gemfile.lock&quot; }}<br>          paths:<br>            - vendor/bundle<br>      - run:<br>          name: Install Firebase CLI (for app distribution action)<br>          command: curl -sL https://firebase.tools | bash<br>      - run:<br>          name: Decode Firebase service account<br>          command: |<br>            echo &quot;$FIREBASE_SERVICE_ACCOUNT_JSON&quot; | base64 --decode &gt; /tmp/firebase-service-account.json<br>            echo &#39;export FIREBASE_CREDENTIALS_PATH=&quot;/tmp/firebase-service-account.json&quot;&#39; &gt;&gt; &quot;$BASH_ENV&quot;<br>            echo &#39;export GOOGLE_APPLICATION_CREDENTIALS=&quot;/tmp/firebase-service-account.json&quot;&#39; &gt;&gt; &quot;$BASH_ENV&quot;<br>      - run:<br>          name: Run Fastlane upload<br>          command: bundle exec fastlane upload<br>          no_output_timeout: 30m<br>workflows:<br>  internal-builds:<br>    jobs:<br>      - ios-upload:<br>          filters:<br>            branches:<br>              ignore: /.*/<br>            tags:<br>              only: /^t\d+\.\d+\.\d+\.\d+$/</pre><h3>Secrets in CircleCI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ma-tzeuDJ-RjHJmnqlasqg.png" /></figure><p>Signing identity and team IDs live in fastlane/Appfile, fastlane/Matchfile, and fastlane/ci.xcconfig.<br>Match sync handles certificates and provisioning profiles during bundle exec fastlane upload.</p><p>For managing one shared CircleCI config across repos, see Centralized CircleCI Pipelines (coming soon).</p><h3>Step 6 — Code signing (the part that breaks everyone)</h3><h3>Before you renew certificates or profiles</h3><p>This is the main reason we use Fastlane in day-to-day operations — not for every developer build, but for signing asset maintenance.</p><blockquote><strong><em>⚠️ Match passphrase reminder:</em></strong><em> if </em><em>MATCH_PASSWORD is lost, encrypted files in the certificates repo cannot be recovered. You must clean the repo and bootstrap Match again.</em></blockquote><p>Before running any certificate/profile renewal:</p><ol><li><strong>Register test devices</strong> in App Store Connect (Devices).</li><li><strong>Add tester emails</strong> to the Firebase tester group (testers — case-sensitive).</li></ol><p>Every time a <strong>new device</strong> is added or a <strong>new tester email</strong> is added, you must refresh certificates and provisioning profiles via Fastlane from the terminal. CI pipelines assume profiles already include the latest device UDIDs and distribution rules.</p><blockquote><strong><em>Footnote:</em></strong><em> After adding a device in App Store Connect, it can sit in </em><strong><em>Processing</em></strong><em> for up to 24 hours. That is normal — timing varies (sometimes instant, sometimes a full day). Deleting and re-adding the same device does not shorten the wait.</em></blockquote><p>There are two sane paths for storing and syncing signing assets:</p><p>For local development, developers use Xcode automatic signing.<br>That means they are not blocked by certificate/profile rotations in CI workflows, and they do not need to exchange signing files between laptops.</p><h3>Option A — fastlane match (best for teams)</h3><ul><li>Stores certs + profiles in a <strong>private git repo</strong></li><li>CI uses match(type: &quot;adhoc&quot;, readonly: true)</li><li>Release owner runs match from terminal when devices/testers change</li></ul><p>First-time bootstrap (match development + match adhoc): <a href="https://medium.com/02-fastlane-match-cert-repo-setup.md">Article #2</a>.<br>Re-run after device/tester changes: <a href="https://medium.com/04-ios-signing-rotation-playbook.md">Article #4</a>.</p><p>If you’re setting up from scratch today, start here.</p><h3>Option B — Manual certs in CI (what we used initially)</h3><ul><li>Export Distribution certificate as .p12</li><li>Download Ad Hoc provisioning profile</li><li>Store both as CircleCI secrets (base64 env vars decoded in a setup step)</li></ul><p>Works, but rotation is painful. We migrated teams toward match over time.</p><p>Manual signing usually creates hidden operational debt: duplicated certs, shared passwords, and unclear ownership. We wanted to eliminate that.</p><p><strong>Ad Hoc vs App Store:</strong> internal Firebase builds use <strong>Ad Hoc</strong> profiles (match adhoc).<br>App Store distribution profiles (fastlane match appstore) are for App Store/TestFlight upload flows.<br>We currently rely on <strong>Xcode Cloud</strong> for a* tester packages, so match appstore is not part of our day-to-day setup.</p><h3>Step 7 — Firebase App Distribution setup</h3><ol><li><a href="https://console.firebase.google.com/">Firebase Console</a> → Add iOS app (bundle ID must match Xcode)</li><li>Download GoogleService-Info.plist into the Xcode target</li><li>Copy GOOGLE_APP_ID from that plist into Fastfile:</li></ol><pre>&lt;!-- GoogleService-Info.plist --&gt;<br>&lt;key&gt;GOOGLE_APP_ID&lt;/key&gt;<br>&lt;string&gt;1:284960396196:ios:fd62d736449a530e64e731&lt;/string&gt;</pre><pre># fastlane/Fastfile<br>firebase_app_distribution(<br>  app: &quot;1:284960396196:ios:fd62d736449a530e64e731&quot;, # GOOGLE_APP_ID<br>  groups: &quot;testers&quot;,<br>  ...<br>)</pre><ol><li>Create a tester group whose <strong>alias</strong> is exactly testers (the value in groups: matches the group alias/ID, not the display name), and add at least one tester email</li></ol><blockquote><strong><em>Gotcha:</em></strong><em> every Firebase project needs its own group. If another app distributes fine and a new one dies at </em><em>Distributing release with </em><em>Invalid request (Google::Apis::ClientError), the new app&#39;s Firebase project is probably missing the group. The upload itself succeeds and the release is created; only the distribute call fails, so the error looks scarier than it is.</em></blockquote><blockquote>Create a Firebase service account and download service-account.json</blockquote><blockquote>Convert that JSON to base64 and store it in CircleCI (not in git)</blockquote><pre># Release owner only, one-time setup<br>base64 -i service-account.json | tr -d &#39;\n&#39; | pbcopy<br># Paste output into CircleCI as FIREBASE_SERVICE_ACCOUNT_JSON</pre><p>On macOS/Linux CI, the job decodes it before Fastlane runs:</p><pre>echo &quot;$FIREBASE_SERVICE_ACCOUNT_JSON&quot; | base64 --decode &gt; /tmp/firebase-service-account.json</pre><p>We do <strong>not</strong> use firebase login:ci token flow. Base64 in CircleCI keeps auth stable and rotatable without touching developer laptops.</p><p>2. First upload can be manual from Firebase console to verify testers receive email invites</p><p><strong>Why Firebase instead of TestFlight for internal builds?</strong></p><ul><li>Faster iteration — no App Store Connect processing wait</li><li>Easier for non-Apple emails on the team</li><li>Clear separation: Firebase = “break things,” TestFlight = “release candidate”</li></ul><p>In our case, both paths can come from the same app code state, but tester experience is different.<br>For fast internal checks, Firebase is more practical. For App Store Connect tester flows (and premium/subscription behavior validation), the a* path is still important.</p><p>We still used TestFlight for late-stage QA on production-bound builds via Xcode Cloud.</p><h3>Step 8 — Production with Xcode Cloud (separate path)</h3><p>We intentionally <strong>did not</strong> wire App Store upload into the same CircleCI Fastfile that broke twice during Apple API changes.</p><p><strong>Xcode Cloud workflow (high level):</strong></p><ol><li>Connect repo in App Store Connect → Xcode Cloud</li><li>Workflow trigger: a* tags (for example a2.5.2.0)</li><li>Actions: Archive → upload to App Store Connect internal testers</li><li>Signing: Xcode Cloud managed certificates (Apple-hosted)</li><li>Xcode + macOS image: always latest release to catch ecosystem changes early</li></ol><p><strong>When this made sense for us:</strong></p><ul><li>Production releases were weekly, not hourly</li><li>We wanted Apple-native signing for App Store builds</li><li>Reducing custom Ruby in the production critical path</li></ul><p><strong>When CircleCI + Fastlane is still better:</strong></p><ul><li>Build speed can be dramatically better (in our case up to 4–5x faster)</li><li>Multiple custom pre-build scripts</li><li>Heavy Firebase / Slack / Jira integration on every commit</li><li>macOS + iOS from one repo with custom logic (we did this for a VPN app targeting both platforms)</li></ul><p>You can run both. They complement each other.</p><h3>Step 9 — Multi-app and multi-platform patterns</h3><p>I’ll cover these patterns in dedicated follow-up articles. Keeping only high-level notes here for context.</p><h3>Several apps, one team</h3><pre># .circleci/config.yml excerpt<br>workflows:<br>  internal-builds:<br>    jobs:<br>      - ios-upload:<br>          name: app-a-upload<br>          context: ios-release-app-a<br>          filters:<br>            branches: { ignore: /.*/ }<br>            tags: { only: /^t\d+\.\d+\.\d+\.\d+$/ }<br>      - ios-upload:<br>          name: app-b-upload<br>          context: ios-release-app-b<br>          filters:<br>            branches: { ignore: /.*/ }<br>            tags: { only: /^t\d+\.\d+\.\d+\.\d+$/ }</pre><p>Same Fastfile, different contexts. Each app gets its own Firebase iOS app id.</p><h3>iOS + macOS from one codebase</h3><ul><li>Separate schemes: MyApp-iOS, MyApp-macOS</li><li>Separate lanes or platform :mac do blocks in Fastfile</li><li>Separate Firebase apps (macOS bundle id differs) or macOS-only TestFlight via Xcode Cloud</li></ul><h3>One codebase → two App Store apps</h3><p>We shipped two consumer apps from shared Swift modules by:</p><ul><li>Two targets, two bundle IDs, two Firebase apps</li><li><strong>Separate CircleCI contexts</strong> (signing + Firebase ids differ)</li><li>Shared Core/ module — lane only changes scheme + env</li></ul><p>Do <strong>not</strong> share provisioning profiles across bundle IDs.</p><h3>Step 10 — Slack / visibility (optional but worth it)</h3><p>Add to the end of upload lane:</p><pre>slack(<br>  message: &quot;New QA build uploaded to Firebase&quot;,<br>  slack_url: ENV[&quot;SLACK_WEBHOOK_URL&quot;],<br>  payload: {<br>    &quot;Build&quot; =&gt; lane_context[SharedValues::BUILD_NUMBER],<br>    &quot;Commit&quot; =&gt; last_git_commit_message<br>  },<br>  default_payloads: [:git_branch, :git_author]<br>)</pre><p>QA stopped asking “is there a new eligible build?” in DMs, because triggers were explicit and visible.</p><h3>Troubleshooting (real failures we hit)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wb8ct-jnm9RDkHpfakhRDg.png" /></figure><p>Enable Fastlane logs in CI:</p><pre>env:<br>  FASTLANE_VERBOSE: &quot;1&quot;</pre><h3>Private SPM packages fail in CI: the deploy key scope trap</h3><p>This one cost us a full day, so here is the complete story.</p><p>A freshly connected CircleCI project failed at xcodebuild -resolvePackageDependencies on <strong>every</strong> private package, while an older project with the same shared config, the same imported env variables, and the same libraries built fine:</p><pre>xcodebuild: error: Could not resolve package dependencies<br>Failed to clone repository https://gitlab.example.com/ios-team/libraries/...<br>remote: The project you were looking for could not be found<br>remote: or you don&#39;t have permission to view it.<br>fatal: Could not read from remote repository.</pre><p>We tried the obvious suspects first, and none of them helped:</p><ul><li>Replaced the SSH keys in CircleCI project settings: no change</li><li>Rotated GITLAB_PASSWORD: no change</li><li>Re-encoded the Firebase service account JSON: unrelated, no change</li></ul><p><strong>How to actually read this error.</strong> The message is not an authentication failure. GitLab authenticated the connection and then refused access to the project. So the question is not “are my credentials wrong” but “<strong>which identity is CI using, and what can that identity see?</strong>”</p><p>The answer: when CircleCI connects a GitLab repo, it registers <strong>deploy keys on that one repo</strong> (ours were titled circleci-pipeline-triggers). GitLab deploy keys are scoped to the project they are registered on. So CI could clone the app repo but got a permission wall on every other private repo: all the SPM package repos, and also the Match certificates repo (git@...URL in Matchfile).</p><p>The older project passed because someone had long ago added an extra SSH key from a user account with group-wide access. The new project never got that key, fell back to its own deploy key, and hit the wall.</p><p><strong>Diagnosis commands (run locally):</strong></p><pre># Which GitLab user does your local key map to?<br>ssh -T git@gitlab.example.com<br># Can that identity read a private package repo?<br>git ls-remote git@gitlab.example.com:ios-team/libraries/somepackage.git HEAD<br># List deploy keys on the app repo (API)<br>curl -s -H &quot;PRIVATE-TOKEN: $TOKEN&quot; \<br>  &quot;https://gitlab.example.com/api/v4/projects/group%2Fapp-repo/deploy_keys&quot;<br># Are there any deploy keys on the package repos? (spoiler: probably none)<br>curl -s -H &quot;PRIVATE-TOKEN: $TOKEN&quot; \<br>  &quot;https://gitlab.example.com/api/v4/projects/ios-team%2Flibraries%2Fsomepackage/deploy_keys&quot;</pre><p><strong>Fix A (what we did): enable the app repo’s deploy keys on every private dependency repo.</strong></p><p>GitLab lets you enable an existing deploy key on other projects. UI path: each package repo → Settings → Repository → Deploy keys → Privately accessible deploy keys → Enable. With many packages, the API loop is faster (needs Maintainer on the target repos):</p><pre>TOKEN=&quot;glpat-...&quot;   # your PAT, api scope, Maintainer on the package repos<br>KEY_ID=81           # deploy key id from the app repo listing above<br>for lib in adjustx analyticsx authx catalystx networkx notificationx; do<br>  curl -s -o /dev/null -w &quot;$lib -&gt; %{http_code}\n&quot; -X POST \<br>    -H &quot;PRIVATE-TOKEN: $TOKEN&quot; \<br>    &quot;https://gitlab.example.com/api/v4/projects/ios-team%2Flibraries%2F$lib/deploy_keys/$KEY_ID/enable&quot;<br>done</pre><p>Do not forget the <strong>Match certificates repo</strong>. It is cloned over SSH too, and it fails with the same wall one step later in the pipeline.</p><p><strong>Fix B (alternative): one CI identity with group access.</strong> Add an SSH key from a user (or service account) that has at least Reporter access on the whole libraries group, as an additional SSH key in CircleCI with the GitLab hostname set. This is the pattern our older projects relied on. It works, but it silently depends on someone remembering to copy that key into every new project, which is exactly how we got here.</p><p><strong>Fix C (HTTPS fallback):</strong> configure git HTTPS auth before package resolve with a PAT that can read all package repos:</p><pre>git config --global \<br>  url.&quot;https://${GITLAB_USER}:${GITLAB_PASSWORD}@gitlab.example.com/&quot;.insteadOf \<br>  &quot;https://gitlab.example.com/&quot;</pre><p>This covers SPM clones, but Match still needs SSH access for the cert repo, so Fix A or B is required anyway.</p><p><strong>Takeaway:</strong> “the same credentials work in other projects” proves nothing when each CI project carries its own machine identity. Find the identity, then check what it can see.</p><h3>Checklist: you’re done when…</h3><ul><li>New test devices registered in App Store Connect before profile renewal</li><li>New tester emails added to Firebase group testers before distribution</li><li>tX.Y.Z.N tag triggers Firebase App Distribution package</li><li>aX.Y.Z.N tag triggers App Store Connect internal-tester package</li><li>QA receives Firebase email / can install from App Distribution</li><li>A new engineer can clone the repo, enable automatic signing in Xcode, and start development</li><li>Signing assets aren’t on one person’s laptop only</li><li>Production release path is documented separately (Xcode Cloud)</li><li>FIREBASE_SERVICE_ACCOUNT_JSON in CircleCI contains base64-encoded service account JSON</li><li>Secrets live in CI contexts, not in git</li></ul><p>That’s the bar. Not slides about CI/CD — a team that ships without you.</p><h3>What I’d do differently today</h3><ol><li><strong>Start with</strong> match <strong>on day one</strong> — manual p12 in CI was fast to ship, expensive to maintain.</li><li><strong>Pin Xcode version in CI</strong> the same week Apple releases a new major — not after the first red build.</li><li><strong>One Fastfile, env-driven</strong> — fewer copy-pasted lanes across apps.</li><li><strong>Document the production path in the README</strong> — even if only Xcode Cloud clicks.</li></ol><h3>Closing</h3><p>You don’t need a platform team to get professional iOS releases. You need:</p><ul><li>One internal loop (tag → package → distribute → feedback) that stays explicit</li><li>One production loop that stays boring</li><li>Signing treated as code, not folklore</li></ul><p>If you’re setting this up solo after inheriting chaos — start with <strong>one app</strong>, <strong>one</strong> t* <strong>tag flow</strong>, <strong>Firebase to your own phone</strong>. Then add stricter release rules and Xcode Cloud.</p><h3>A note on how this article was written</h3><p>English is not my first language, so I used AI while preparing this article — mostly for wording, structure, and clarity. The experiences, decisions, and trade-offs here are mine, drawn from real mobile release work across different companies.</p><p><strong>About the author</strong></p><p>Senior iOS Engineer. I build consumer apps in Swift/SwiftUI and own mobile release infrastructure — CircleCI, Fastlane, Firebase App Distribution, and Xcode Cloud.</p><p>🔗 GitHub: <a href="https://github.com/huseyiniyibas">github.com/huseyiniyibas</a><br>🔗 Open source: <a href="https://github.com/huseyiniyibas/MeerkatKit">MeerkatKit</a><br>🔗 LinkedIn: <a href="https://linkedin.com/in/huseyiniyibas">linkedin.com/in/huseyiniyibas</a><br>🔗 X (Twitter): <a href="https://x.com/iyibash">x.com/iyibash</a><br>🔗 Medium: <a href="https://iyibash.medium.com/">iyibash.medium.com</a></p><p><em>Hey human, if you’re reading this, we still need you. That means real work is still done by people. And if you found this by accident, or buried inside an AI deep-thinking trail, maybe there’s still hope for all of us.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=289022822b10" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>