<?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 Shahrukh Shikalgar on Medium]]></title>
        <description><![CDATA[Stories by Shahrukh Shikalgar on Medium]]></description>
        <link>https://medium.com/@shaharukhs?source=rss-2afb3742fae3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vils91zeppuEjxD3oXEbhQ.jpeg</url>
            <title>Stories by Shahrukh Shikalgar on Medium</title>
            <link>https://medium.com/@shaharukhs?source=rss-2afb3742fae3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:55:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shaharukhs/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[Ship iOS apps without ever opening Xcode’s Archive button again.]]></title>
            <link>https://medium.com/@shaharukhs/ship-ios-apps-without-ever-opening-xcodes-archive-button-again-433052bc5140?source=rss-2afb3742fae3------2</link>
            <guid isPermaLink="false">https://medium.com/p/433052bc5140</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Shahrukh Shikalgar]]></dc:creator>
            <pubDate>Thu, 07 May 2026 06:35:33 GMT</pubDate>
            <atom:updated>2026-05-07T06:35:59.236Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdRBdjDtvHpNK-kIEZRM4A.png" /><figcaption><strong>shipping on autopilot</strong></figcaption></figure><p><em>A complete GitHub Actions guide for iOS — secrets, certificates, Firebase, TestFlight.</em></p><p>If you’re an iOS dev still doing this manually:</p><ol><li>Open Xcode</li><li>Wait for indexing</li><li>Product → Archive</li><li>Wait 10 minutes</li><li>Distribute App</li><li>Click through 6 wizard screens</li><li>Wait for upload to TestFlight</li><li>Realize you forgot to bump the build number</li><li>Cry</li></ol><p>…you are about to get those 45 minutes back, every single time.</p><p>This post walks through a <strong>production-ready GitHub Actions workflow</strong> for iOS that handles signing, secret injection, Firebase App Distribution, and TestFlight upload — automatically. It’s the same architecture I use on real client work; I’ve just stripped the project-specific stuff so you can drop it in.</p><h3>What you’ll have at the end</h3><p>A single workflow you trigger with one click in GitHub Actions:</p><ul><li>🎯 Pick environment: <strong>DEV</strong> or <strong>PROD</strong></li><li>🚀 Pick distribution: <strong>Firebase</strong> or <strong>TestFlight</strong></li><li>✅ Build, sign, archive, export, upload — all automated</li><li>🔐 All secrets injected at build time, nothing committed to git</li><li>🪲 Auto-creates a GitHub Issue if anything fails</li></ul><p>The whole thing runs on a macos-latest runner, takes about 12–15 minutes, and never asks you a single question.</p><h3>Part 1: The foundation — secrets and certificates</h3><p>Before any YAML, you need to convert everything sensitive into base64 strings and store them as GitHub Secrets. This is the part most tutorials skip and it’s where 90% of dev teams get stuck.</p><h3>1.1 The .p12 certificate (your signing identity)</h3><p>Export your iOS Distribution certificate from Keychain Access as a .p12 file with a password. Then:</p><pre>base64 -i Certificates.p12 | pbcopy</pre><p>The base64 string is now on your clipboard. Save it as a GitHub Secret named BUILD_CERTIFICATE_BASE64. Save the .p12 password as P12_PASSWORD.</p><h3>1.2 Provisioning profile(s)</h3><p>Download your .mobileprovision from the Apple Developer portal. Then:</p><pre>base64 -i YourApp.mobileprovision | pbcopy</pre><p>Save as BUILD_PROVISION_PROFILE_BASE64.</p><p>If you have a widget extension or other targets, repeat for each. The example below uses one main profile + one widget profile (BUILD_PROVISION_PROFILE_WIDGET_BASE64).</p><h3>1.3 App Store Connect API key (the modern way)</h3><p>Stop using your Apple ID password. Get an API key instead:</p><ol><li>Go to <strong>App Store Connect → Users and Access → Integrations → App Store Connect API</strong></li><li>Generate a new key with <strong>App Manager</strong> role</li><li>Download the .p8 file (you can only download it ONCE — save it carefully)</li><li>Note the <strong>Key ID</strong> and <strong>Issuer ID</strong> shown on the page</li></ol><p>Then:</p><pre>base64 -i AuthKey_XXXXXXXXXX.p8 | pbcopy</pre><p>Save these GitHub Secrets:</p><ul><li>APPSTORE_API_PRIVATE_KEY → the base64&#39;d .p8</li><li>APPSTORE_API_KEY_ID → the Key ID (looks like ABC123XYZ9)</li><li>APPSTORE_ISSUER_ID → the Issuer ID (a UUID)</li></ul><h3>1.4 ExportOptions.plist</h3><p>Create your ExportOptions.plist once locally (Xcode generates this when you archive manually — copy it from the resulting .xcarchive). Then:</p><pre>base64 -i ExportOptions.plist | pbcopy</pre><p>Save as EXPORT_OPTIONS_PLIST.</p><h3>1.5 Firebase (only if using Firebase App Distribution)</h3><p>You need two things:</p><ul><li><strong>GoogleService-Info.plist</strong> — base64 it, save as GOOGLESERVICE_INFO_BASE64</li><li><strong>Firebase service account JSON</strong> — Generate one in Firebase Console → Project Settings → Service accounts. Save the raw JSON content as FIREBASE_AUTH_TOKEN.</li><li><strong>Firebase App ID</strong> (looks like 1:1234567890:ios:abc...) → save as FIREBASE_APP_ID</li></ul><h3>1.6 Keychain password</h3><p>This is just a random string the runner uses to lock its temporary keychain. Generate any strong password and save as KEYCHAIN_PASSWORD. It doesn&#39;t need to match anything else.</p><h3>📋 Complete secrets checklist</h3><p>Secret name What it is BUILD_CERTIFICATE_BASE64 base64&#39;d .p12 P12_PASSWORD password set when exporting .p12 BUILD_PROVISION_PROFILE_BASE64 base64&#39;d .mobileprovision BUILD_PROVISION_PROFILE_WIDGET_BASE64 (optional) widget profile KEYCHAIN_PASSWORD any strong random string APPSTORE_API_PRIVATE_KEY base64&#39;d .p8 APPSTORE_API_KEY_ID from App Store Connect APPSTORE_ISSUER_ID from App Store Connect EXPORT_OPTIONS_PLIST base64&#39;d ExportOptions.plist GOOGLESERVICE_INFO_BASE64 base64&#39;d Firebase config (if using) FIREBASE_AUTH_TOKEN service account JSON (if using) FIREBASE_APP_ID Firebase app ID (if using)</p><p>⚡ <strong>Pro tip:</strong> put all your project’s API keys (analytics SDKs, third-party APIs) in GitHub Secrets too. Then inject them into your .xcconfig at build time using a small shell script. Never commit API keys to git — even in private repos. We&#39;ll set that up below.</p><h3>Part 2: The workflow architecture</h3><p>Here’s how the pipeline is split into jobs:</p><pre>setup ──┬── configure-signing ─┐<br>        ├── inject-secrets ────┼── build-archive ──┬── upload-firebase<br>        │                      │                   └── export-ipa ── upload-testflight<br>        └── (artifacts)        │<br>                               └── notify-on-failure (if anything breaks)</pre><p>Why split jobs? <strong>Speed and isolation.</strong> Setup runs once, signing/secrets run in parallel, build pulls everything together, distribution branches based on user input. Each job uploads artifacts so the next job doesn’t repeat work.</p><h3>Part 3: The workflow file</h3><p>Drop this in .github/workflows/ios.yml. I&#39;ll explain each section after.</p><h3>Header and inputs</h3><pre>name: &quot;Build iOS app&quot;<br>permissions:<br>  contents: read<br>on:<br>  workflow_dispatch:<br>    inputs:<br>      targetEnvironment:<br>        description: &quot;Target Environment&quot;<br>        required: true<br>        type: choice<br>        default: DEV<br>        options: [DEV, PROD]<br>      distributionTarget:<br>        description: &quot;Distribution Target&quot;<br>        required: true<br>        type: choice<br>        default: Firebase<br>        options: [Firebase, TestFlight]<br>env:<br>  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}<br>  XCODE_VERSION: latest-stable</pre><p>The workflow_dispatch block gives you a <strong>&quot;Run workflow&quot; button</strong> in the GitHub Actions UI with two dropdowns. No code change needed to switch between Dev and Prod, Firebase and TestFlight.</p><h3>Job 1: Setup</h3><pre>jobs:<br>  setup:<br>    name: Setup Environment (${{ inputs.targetEnvironment }})<br>    runs-on: macos-latest<br>    outputs:<br>      scheme: ${{ steps.set-scheme.outputs.scheme }}<br>      config-file: ${{ steps.set-config.outputs.config-file }}<br>    steps:<br>    - uses: maxim-lobanov/setup-xcode@v1<br>      with:<br>        xcode-version: ${{ env.XCODE_VERSION }}<br>    - name: Check Xcode version<br>      run: xcodebuild -version<br>    - uses: actions/checkout@v4<br>    - name: Set build scheme<br>      id: set-scheme<br>      run: |<br>        if [[ &quot;${{ inputs.targetEnvironment }}&quot; == &quot;DEV&quot; ]]; then<br>          echo &quot;scheme=MyApp Dev&quot; &gt;&gt; $GITHUB_OUTPUT<br>        else<br>          echo &quot;scheme=MyApp Prod&quot; &gt;&gt; $GITHUB_OUTPUT<br>        fi<br>    - name: Set config file path<br>      id: set-config<br>      run: |<br>        if [[ &quot;${{ inputs.targetEnvironment }}&quot; == &quot;DEV&quot; ]]; then<br>          echo &quot;config-file=MyApp/Config/Dev.xcconfig&quot; &gt;&gt; $GITHUB_OUTPUT<br>        else<br>          echo &quot;config-file=MyApp/Config/Prod.xcconfig&quot; &gt;&gt; $GITHUB_OUTPUT<br>        fi</pre><p>This job decides the scheme name and config file based on the dropdown. <strong>Replace </strong><strong>MyApp Dev, </strong><strong>MyApp Prod, and the config paths with yours.</strong></p><h3>Job 2: Configure Code Signing</h3><p>This is the magic step that makes the runner act like your Mac:</p><pre>configure-signing:<br>    name: Configure Code Signing<br>    runs-on: macos-latest<br>    needs: setup<br>    steps:<br>    - uses: actions/checkout@v4<br>    - name: Set up provisioning profile and certificate<br>      env:<br>        BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}<br>        P12_PASSWORD: ${{ secrets.P12_PASSWORD }}<br>        BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}<br>        KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}<br>      run: |<br>        CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12<br>        PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision<br>        KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db<br>        # Decode base64 secrets back to files<br>        echo -n &quot;$BUILD_CERTIFICATE_BASE64&quot; | base64 --decode -o $CERTIFICATE_PATH<br>        echo -n &quot;$BUILD_PROVISION_PROFILE_BASE64&quot; | base64 --decode -o $PP_PATH<br>        # Create a fresh temporary keychain<br>        security create-keychain -p &quot;$KEYCHAIN_PASSWORD&quot; $KEYCHAIN_PATH<br>        security set-keychain-settings -lut 21600 $KEYCHAIN_PATH<br>        security unlock-keychain -p &quot;$KEYCHAIN_PASSWORD&quot; $KEYCHAIN_PATH<br>        # Import the .p12 into the keychain<br>        security import $CERTIFICATE_PATH -P &quot;$P12_PASSWORD&quot; -A -t cert -f pkcs12 -k $KEYCHAIN_PATH<br>        security list-keychain -d user -s $KEYCHAIN_PATH<br>        # Install provisioning profile<br>        mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles<br>        cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles<br>    - name: Upload signing artifacts<br>      uses: actions/upload-artifact@v4<br>      with:<br>        name: signing-files<br>        path: |<br>          ${{ runner.temp }}/build_certificate.p12<br>          ${{ runner.temp }}/build_pp.mobileprovision<br>        retention-days: 1</pre><p><strong>What’s happening:</strong> the runner is a fresh Mac. It has no keychain entries, no certificates, no provisioning profiles. We decode our base64 secrets back into files, create a temporary keychain, import the cert, and copy the profile to where macOS expects it. Same as if you set up a new Mac for development — just scripted.</p><p>⚡ <strong>Why upload artifacts?</strong> Later jobs (build-archive, export-ipa) need the same signing setup. Uploading once and downloading later is faster than redoing the base64 decode in every job.</p><h3>Job 3: Inject API keys into xcconfig</h3><p>This is where you replace placeholders in your .xcconfig with real API keys at build time. Create .github/scripts/inject-secrets.sh:</p><pre>#!/bin/bash<br>set -e<br>ENVIRONMENT=$1<br>CONFIG_FILE=$2<br>echo &quot;Injecting secrets into $CONFIG_FILE for $ENVIRONMENT...&quot;<br># Replace placeholders. Add one line per secret.<br># Your .xcconfig should have lines like: API_BASE_URL = ${API_BASE_URL}<br># (Note: actual xcconfig syntax — see the gotcha below)<br>sed -i &#39;&#39; &quot;s|__API_BASE_URL__|$API_BASE_URL|g&quot; &quot;$CONFIG_FILE&quot;<br>sed -i &#39;&#39; &quot;s|__ANALYTICS_KEY__|$ANALYTICS_KEY|g&quot; &quot;$CONFIG_FILE&quot;<br># ... add a sed line per secret</pre><p>⚡ <strong>xcconfig gotcha:</strong> .xcconfig files use $() for variable substitution at <em>Xcode build time</em>. To inject values at <em>CI time</em>, use a placeholder pattern that won&#39;t conflict — e.g. __API_BASE_URL__. Then sed replaces those placeholders with real values.</p><p>Then in the workflow:</p><pre>inject-secrets:<br>    name: Inject Secrets<br>    runs-on: macos-latest<br>    needs: setup<br>    steps:<br>    - uses: actions/checkout@v4<br>    - name: Inject secrets into xcconfig<br>      env:<br>        API_BASE_URL: ${{ secrets.API_BASE_URL }}<br>        ANALYTICS_KEY: ${{ secrets.ANALYTICS_KEY }}<br>        # Add more secrets your app needs here<br>      run: |<br>        chmod +x .github/scripts/inject-secrets.sh<br>        .github/scripts/inject-secrets.sh &quot;${{ inputs.targetEnvironment }}&quot; &quot;${{ needs.setup.outputs.config-file }}&quot;<br>    - name: Upload modified config artifact<br>      uses: actions/upload-artifact@v4<br>      with:<br>        name: xcconfig-with-secrets<br>        path: MyApp/Config/*.xcconfig<br>        retention-days: 1</pre><h3>Job 4: Build &amp; Archive</h3><pre>build-archive:<br>    name: Build &amp; Archive<br>    runs-on: macos-latest<br>    needs: [setup, configure-signing, inject-secrets]<br>    steps:<br>    - uses: maxim-lobanov/setup-xcode@v1<br>      with:<br>        xcode-version: ${{ env.XCODE_VERSION }}<br>    - uses: actions/checkout@v4<br>    - name: Download signing artifacts<br>      uses: actions/download-artifact@v4<br>      with:<br>        name: signing-files<br>        path: ${{ runner.temp }}/signing<br>    - name: Download modified config<br>      uses: actions/download-artifact@v4<br>      with:<br>        name: xcconfig-with-secrets<br>        path: MyApp/Config/<br>    - name: Setup GoogleService-Info.plist<br>      env:<br>        GOOGLESERVICE_INFO_BASE64: ${{ secrets.GOOGLESERVICE_INFO_BASE64 }}<br>      run: |<br>        mkdir -p MyApp/Firebase<br>        echo -n &quot;$GOOGLESERVICE_INFO_BASE64&quot; | base64 --decode -o MyApp/Firebase/GoogleService-Info.plist<br>    - name: Restore signing in this job&#39;s keychain<br>      env:<br>        KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}<br>        P12_PASSWORD: ${{ secrets.P12_PASSWORD }}<br>      run: |<br>        # (Same keychain setup as configure-signing job — runners don&#39;t share filesystem state)<br>        # Full snippet in the GitHub repo below.<br>    - name: Cache SPM dependencies<br>      uses: actions/cache@v4<br>      with:<br>        path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts<br>        key: ${{ runner.os }}-spm-${{ hashFiles(&#39;**/Package.resolved&#39;) }}<br>    - name: Build archive<br>      run: |<br>        xcodebuild archive \<br>          -scheme &quot;${{ needs.setup.outputs.scheme }}&quot; \<br>          -archivePath $RUNNER_TEMP/MyApp.xcarchive \<br>          -project MyApp.xcodeproj \<br>          -destination generic/platform=iOS \<br>          -allowProvisioningUpdates \<br>          CODE_SIGN_STYLE=Manual<br>    - name: Compress and upload archive<br>      run: |<br>        cd $RUNNER_TEMP<br>        tar -czf MyApp.xcarchive.tar.gz MyApp.xcarchive<br>    - uses: actions/upload-artifact@v4<br>      with:<br>        name: app-archive<br>        path: ${{ runner.temp }}/MyApp.xcarchive.tar.gz<br>        retention-days: 1</pre><p>⚡ <strong>Why compress the archive?</strong> GitHub artifact uploads are slow. A .xcarchive is a folder with thousands of small files. Tar+gzip turns it into one file that uploads 10x faster.</p><p>⚡ <strong>The SPM cache is huge.</strong> First build takes ~15 min. Subsequent builds with cache hits: ~5 min. Worth setting up.</p><h3>Job 5a: Distribute via Firebase App Distribution</h3><pre>upload-firebase:<br>    name: Upload to Firebase<br>    runs-on: macos-latest<br>    needs: [setup, configure-signing, build-archive]<br>    if: inputs.distributionTarget == &#39;Firebase&#39;<br>    steps:<br>    - uses: maxim-lobanov/setup-xcode@v1<br>    - uses: actions/checkout@v4<br>    - name: Download archive<br>      uses: actions/download-artifact@v4<br>      with:<br>        name: app-archive<br>        path: ${{ runner.temp }}<br>    - name: Extract archive<br>      run: |<br>        cd $RUNNER_TEMP &amp;&amp; tar -xzf MyApp.xcarchive.tar.gz<br>    # ... (restore signing keychain, same as build-archive)<br>    - name: Export IPA<br>      env:<br>        EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}<br>      run: |<br>        EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist<br>        echo -n &quot;$EXPORT_OPTIONS_PLIST&quot; | base64 --decode -o $EXPORT_OPTS_PATH<br>        xcodebuild -exportArchive \<br>          -archivePath $RUNNER_TEMP/MyApp.xcarchive \<br>          -exportOptionsPlist $EXPORT_OPTS_PATH \<br>          -exportPath $RUNNER_TEMP/firebase-build \<br>          -allowProvisioningUpdates<br>    - name: Install Firebase CLI<br>      run: curl -sL https://firebase.tools | bash<br>    - name: Setup Firebase credentials<br>      env:<br>        FIREBASE_AUTH_TOKEN: ${{ secrets.FIREBASE_AUTH_TOKEN }}<br>      run: echo &quot;$FIREBASE_AUTH_TOKEN&quot; &gt; $RUNNER_TEMP/firebase-service-account.json<br>    - name: Upload to Firebase App Distribution<br>      env:<br>        GOOGLE_APPLICATION_CREDENTIALS: ${{ runner.temp }}/firebase-service-account.json<br>      run: |<br>        IPA_PATH=$(find $RUNNER_TEMP/firebase-build -name &quot;*.ipa&quot; | head -n 1)<br>        firebase appdistribution:distribute &quot;$IPA_PATH&quot; \<br>          --app ${{ secrets.FIREBASE_APP_ID }} \<br>          --groups &quot;ios-testers&quot; \<br>          --release-notes &quot;Build #${{ github.run_number }}, Branch: ${{ env.BRANCH_NAME }}&quot;<br>    - name: Cleanup<br>      if: always()<br>      run: rm -f $RUNNER_TEMP/firebase-service-account.json</pre><h3>Job 5b: Distribute via TestFlight</h3><pre>upload-testflight:<br>    name: Upload to TestFlight<br>    runs-on: macos-latest<br>    needs: [setup, configure-signing, build-archive]<br>    if: inputs.distributionTarget == &#39;TestFlight&#39;<br>    steps:<br>    # ... (same setup, download archive, restore signing, export IPA)<br>    - name: Decode App Store Connect API key<br>      env:<br>        API_KEY_BASE64: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}<br>      run: |<br>        mkdir -p ~/private_keys<br>        echo -n &quot;$API_KEY_BASE64&quot; | base64 --decode -o ~/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8<br>        chmod 600 ~/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8<br>    - name: Validate with App Store Connect<br>      env:<br>        API_KEY: ${{ secrets.APPSTORE_API_KEY_ID }}<br>        API_ISSUER: ${{ secrets.APPSTORE_ISSUER_ID }}<br>      run: |<br>        IPA_PATH=$(find ${{ runner.temp }}/build -name &quot;*.ipa&quot; | head -n 1)<br>        xcrun altool --validate-app -f &quot;$IPA_PATH&quot; --type ios \<br>          --apiKey $API_KEY --apiIssuer $API_ISSUER<br>    - name: Upload to TestFlight<br>      env:<br>        API_KEY: ${{ secrets.APPSTORE_API_KEY_ID }}<br>        API_ISSUER: ${{ secrets.APPSTORE_ISSUER_ID }}<br>      run: |<br>        IPA_PATH=$(find ${{ runner.temp }}/build -name &quot;*.ipa&quot; | head -n 1)<br>        xcrun altool --output-format xml --upload-app -f &quot;$IPA_PATH&quot; --type ios \<br>          --apiKey $API_KEY --apiIssuer $API_ISSUER<br>    - name: Cleanup<br>      if: always()<br>      run: rm -rf ~/private_keys</pre><p>⚡ <strong>Why </strong><strong>xcrun altool and not Fastlane?</strong> It&#39;s built into Xcode. Zero dependencies. The App Store Connect API key + Issuer ID combo is the modern, password-free way to upload. Fastlane is great, but for a CI workflow you don&#39;t actually need it.</p><h3>Job 6: Notify on failure</h3><p>This is the underrated part — when something breaks at 2am, you want to know:</p><pre>notify-on-failure:<br>    name: Notify Team on Failure<br>    runs-on: ubuntu-latest<br>    needs: [setup, configure-signing, inject-secrets, build-archive, upload-firebase, upload-testflight]<br>    if: ${{ always() &amp;&amp; contains(needs.*.result, &#39;failure&#39;) }}<br>    permissions:<br>      issues: write<br>    steps:<br>    - uses: actions/github-script@v7<br>      with:<br>        script: |<br>          await github.rest.issues.create({<br>            owner: context.repo.owner,<br>            repo: context.repo.repo,<br>            title: `[iOS] Build Failed — #${context.runNumber}`,<br>            body: [<br>              `## Build Failure`,<br>              ``,<br>              `| Field | Value |`,<br>              `|-------|-------|`,<br>              `| **Environment** | ${context.payload.inputs.targetEnvironment} |`,<br>              `| **Distribution** | ${context.payload.inputs.distributionTarget} |`,<br>              `| **Branch** | \`${context.ref.replace(&#39;refs/heads/&#39;, &#39;&#39;)}\` |`,<br>              `| **Triggered by** | @${context.actor} |`,<br>              `| **Logs** | [View run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) |`,<br>            ].join(&#39;\n&#39;),<br>            labels: [&#39;ci-failure&#39;],<br>          });</pre><p>Auto-creates a GitHub Issue with all the context. No more “the build failed last night” with no detail.</p><h3>Part 4: Hard-won lessons from running this in production</h3><p>Things that took me too long to figure out:</p><p><strong>1. The keychain has to be re-created in every job.</strong> GitHub runners don’t share filesystem state across jobs — even within the same workflow. So if build-archive and export-ipa both need to sign, both jobs must re-import the cert. Yes, it&#39;s annoying. Yes, it works.</p><p><strong>2. </strong><strong>set-key-partition-list is the silent killer.</strong> If your build fails with errSecInternalComponent during code signing, you forgot this line:</p><pre>security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k &quot;$KEYCHAIN_PASSWORD&quot; $KEYCHAIN_PATH</pre><p>It tells macOS that codesign is allowed to use the imported key without a popup. Required on CI runners.</p><p><strong>3. Provisioning profiles need their UUID as filename in some cases.</strong> xcodebuild -exportArchive looks them up by UUID, not by file path. If you&#39;re getting &quot;no provisioning profile matches&quot; errors during export, do this:</p><pre>PP_UUID=$(/usr/libexec/PlistBuddy -c &quot;Print :UUID&quot; /dev/stdin &lt;&lt;&lt; $(security cms -D -i $PP_PATH))<br>cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$PP_UUID.mobileprovision</pre><p><strong>4. Pin your action versions to commit SHAs in production.</strong> A GitHub Action you depend on can be compromised — using @v4 means you&#39;ll silently get the new code. Using @&lt;full-sha&gt; means you control upgrades. Add a comment block at the top of the YAML mapping each version tag to its SHA so you can update them all with find-and-replace.</p><p><strong>5. </strong><strong>latest-stable for Xcode is a trap on big projects.</strong> When Apple releases a new Xcode, your build can break the next morning with no code changes. For production pipelines, pin to a specific Xcode version (16.4, 26.0, etc.) and upgrade deliberately.</p><h3>What’s next</h3><p>Once this is running, the iOS build pipeline becomes a non-event. You stop thinking about it. PRs get merged, builds appear in Firebase, TestFlight rolls out — without anyone touching Xcode.</p><p>The follow-ups I’d add next, depending on your team:</p><ul><li><strong>Auto-increment build numbers</strong> based on github.run_number</li><li><strong>Slack notification</strong> on success (in addition to issue on failure)</li><li><strong>PR builds</strong> that auto-deploy to Firebase preview groups</li><li><strong>Branch-based environments</strong> (any push to develop builds Dev automatically)</li></ul><p>If you’ve been doing manual archives, this single workflow buys you an hour back per release. Across a year of bi-weekly releases, that’s <strong>~25 hours</strong>. And nobody ever forgets to bump the build number again.</p><p>What’s the most painful part of <em>your</em> iOS release process? Drop it in the comments 👇</p><p><em>#iOSDev #CICD #GitHubActions #Swift #Fastlane #TestFlight #Firebase #DevOps</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=433052bc5140" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop writing iOS boilerplate. Let Claude do the boring work.]]></title>
            <link>https://medium.com/@shaharukhs/stop-writing-ios-boilerplate-let-claude-do-the-boring-work-2ac0ce69dbde?source=rss-2afb3742fae3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ac0ce69dbde</guid>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Shahrukh Shikalgar]]></dc:creator>
            <pubDate>Tue, 05 May 2026 06:35:16 GMT</pubDate>
            <atom:updated>2026-05-05T06:35:16.047Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nfEHi-X7ptgMoRBebYY7A.png" /><figcaption><strong>let claude cook</strong></figcaption></figure><p><em>Updated for Xcode 26 + iOS 26 + Swift 6.2</em></p><p>Most iOS devs use AI to “write me a SwiftUI view.” That’s the small win.</p><p>The big win? Pointing AI at the <strong>boring scaffolding</strong> that eats hours every sprint — Codable models, mock data, Swift Testing files, SwiftUI Previews.</p><p>Even better in Xcode 26: Apple shipped <strong>built-in AI coding assistance</strong> that integrates with Claude directly inside the IDE — no copy-pasting between tabs anymore. The prompts below work the same whether you use Xcode 26’s built-in assistant or Claude Code in your terminal.</p><p>Here are 4 prompts I use weekly that save me 5+ hours every week as a SwiftUI dev.</p><h3>1. Generate Codable structs from a JSON API response</h3><p>You got the API. The Swagger docs are wrong. You have one sample response. Typing the model by hand with proper optionals, CodingKeys, and snake_case mapping is a 30-minute nightmare.</p><p><strong>The prompt:</strong></p><pre>Generate Swift Codable structs from this JSON response.<br><br>Rules:<br>- Use snake_case → camelCase mapping via CodingKeys<br>- Mark fields optional only if they&#39;re actually nullable<br>- Use Date type for ISO 8601 strings (with proper decoder strategy noted)<br>- Use enums with String raw values for finite string sets<br>- Make all structs Identifiable where there&#39;s an `id` field<br>- Add Hashable + Sendable conformance (Swift 6 strict concurrency)<br>- Group related types in a single file<br><br>JSON:<br>{<br>  &quot;id&quot;: &quot;ord_8a2f&quot;,<br>  &quot;status&quot;: &quot;shipped&quot;,<br>  &quot;items&quot;: [<br>   { &quot;sku&quot;: &quot;ABC-123&quot;, &quot;qty&quot;: 2, &quot;price_cents&quot;: 1999 }<br>  ],<br>  &quot;shipped_at&quot;: &quot;2025-01-15T10:30:00Z&quot;,<br>  &quot;tracking_number&quot;: null<br>}</pre><p><strong>What you get:</strong></p><pre>import Foundation<br><br>struct Order: Codable, Identifiable, Hashable, Sendable {<br>    let id: String<br>    let status: Status<br>    let items: [OrderItem]<br>    let shippedAt: Date?<br>    let trackingNumber: String?<br>    enum Status: String, Codable, Hashable, Sendable {<br>        case pending, shipped, delivered, cancelled<br>    }<br>    enum CodingKeys: String, CodingKey {<br>        case id, status, items<br>        case shippedAt = &quot;shipped_at&quot;<br>        case trackingNumber = &quot;tracking_number&quot;<br>    }<br>}<br><br>struct OrderItem: Codable, Hashable, Sendable {<br>    let sku: String<br>    let qty: Int<br>    let priceCents: Int<br>    enum CodingKeys: String, CodingKey {<br>        case sku, qty<br>        case priceCents = &quot;price_cents&quot;<br>    }<br>}<br><br>// Configure your JSONDecoder with:<br>// decoder.dateDecodingStrategy = .iso8601</pre><p>⚡ <strong>Pro tip:</strong> Paste 2–3 different responses, not just one. The AI infers which fields are <em>actually</em> optional vs always present. Way more accurate than guessing from a single sample.</p><p>⚡ <strong>Swift 6 tip:</strong> Always include Sendable in the prompt. Strict concurrency is the default in Xcode 26 for new projects, and forgetting Sendable will hit you with warnings later.</p><h3>2. Generate Swift Testing files from a SwiftUI view model</h3><p>Apple’s Swift Testing framework is the default in Xcode 26. Plus, Xcode 26 brought new features like <strong>Attachments</strong> (capture data alongside test results) and <strong>Exit Tests</strong> (verify code that crashes on purpose). Writing tests for an existing @Observable view model is a perfect AI task.</p><p><strong>The prompt:</strong></p><pre>Read OrderListViewModel.swift and generate a Swift Testing file <br>at OrderListViewModelTests.swift.<br><br>Requirements:<br>- Use the Swift Testing framework (@Test, #expect, @Suite)<br>- Cover every public method<br>- Test loading, success, and error states<br>- Use confirmation() for async expectations<br>- Mock the network layer with a protocol-based fake<br>- Group related tests with @Suite<br>- Use parameterized tests with arguments: where it makes sense<br>- Add Attachment.record() for diagnostic data on failures</pre><p><strong>What you get:</strong></p><pre>import Testing<br>@testable import MyApp<br>@Suite(&quot;OrderListViewModel&quot;)<br>struct OrderListViewModelTests {<br>    @Test(&quot;loads orders successfully on appear&quot;)<br>    func loadOrders_success() async throws {<br>        let fake = FakeOrderService(result: .success([.mock]))<br>        let sut = OrderListViewModel(service: fake)<br>        <br>        await sut.loadOrders()<br>        <br>        #expect(sut.orders.count == 1)<br>        #expect(sut.state == .loaded)<br>    }<br><br>    @Test(&quot;transitions to error state on network failure&quot;)<br>    func loadOrders_failure() async throws {<br>        let fake = FakeOrderService(result: .failure(NetworkError.offline))<br>        let sut = OrderListViewModel(service: fake)<br>        <br>        await sut.loadOrders()<br>        <br>        // New in Xcode 26: attach diagnostic data to failures<br>        Attachment.record(sut.state, named: &quot;Final state&quot;)<br>        <br>        #expect(sut.state == .error)<br>        #expect(sut.orders.isEmpty)<br>    }<br><br>    @Test(&quot;filter status&quot;, arguments: [<br>        OrderStatus.pending, .shipped, .delivered<br>    ])<br>    func filterByStatus(_ status: OrderStatus) async throws {<br>        let sut = OrderListViewModel(service: .withMockedOrders)<br>        await sut.loadOrders()<br>        <br>        sut.applyFilter(status: status)<br>        <br>        #expect(sut.filteredOrders.allSatisfy { $0.status == status })<br>    }<br>}<br><br>// MARK: - Test Doubles<br>final class FakeOrderService: OrderServicing {<br>    let result: Result&lt;[Order], Error&gt;<br>    init(result: Result&lt;[Order], Error&gt;) { self.result = result }<br>    <br>    func fetchOrders() async throws -&gt; [Order] {<br>        try result.get()<br>    }<br>}</pre><p>⚡ <strong>Pro tip:</strong> Add a TESTING.md to your repo describing your conventions (mock naming, sut vs full names, async patterns). Reference it in the prompt: <em>&quot;Follow conventions in TESTING.md.&quot;</em> Output matches your team style instead of generic AI defaults.</p><h3>3. Generate mock data factories for SwiftUI Previews</h3><p>Xcode 26 made #Preview even better — but every dev still writes Order(id: &quot;1&quot;, status: .shipped, ...) inline. It&#39;s noise, repetitive, and never covers edge cases.</p><p><strong>The prompt:</strong></p><pre>For every Codable struct in Models/Order.swift, generate a <br>PreviewData.swift file with static mock factories.<br><br>Requirements:<br>- Add a static .mock property with realistic data<br>- Add a static .mockArray with 5 varied items<br>- Add specific named mocks for edge cases (.empty, .longText, .errorState)<br>- Wrap in #if DEBUG so it doesn&#39;t ship to production<br>- Use realistic data, not &quot;lorem ipsum&quot;</pre><p><strong>What you get:</strong></p><pre>#if DEBUG<br>import Foundation<br><br>extension Order {<br>    static let mock = Order(<br>        id: &quot;ord_8a2f&quot;,<br>        status: .shipped,<br>        items: [.mock],<br>        shippedAt: Date(),<br>        trackingNumber: &quot;1Z999AA10123456784&quot;<br>    )<br><br>    static let mockPending = Order(<br>        id: &quot;ord_pending&quot;,<br>        status: .pending,<br>        items: [.mock, .mockExpensive],<br>        shippedAt: nil,<br>        trackingNumber: nil<br>    )<br><br>    static let mockArray: [Order] = [<br>        .mock, .mockPending,<br>        Order(id: &quot;ord_3&quot;, status: .delivered,<br>              items: [.mock], shippedAt: .now.addingTimeInterval(-86400),<br>              trackingNumber: &quot;1Z999AA10123456785&quot;)<br>    ]<br>}<br><br>extension OrderItem {<br>    static let mock = OrderItem(sku: &quot;ABC-123&quot;, qty: 2, priceCents: 1999)<br>    static let mockExpensive = OrderItem(sku: &quot;XYZ-999&quot;, qty: 1, priceCents: 49900)<br>}<br>#endif</pre><p>Now your previews stay clean:</p><pre>#Preview(&quot;Loaded&quot;) {<br>    OrderListView(orders: .mockArray)<br>}<br><br>#Preview(&quot;Empty&quot;) {<br>    OrderListView(orders: [])<br>}<br><br>#Preview(&quot;Pending only&quot;) {<br>    OrderListView(orders: [.mockPending])<br>}</pre><p>⚡ <strong>Bonus:</strong> Ask Claude to also generate previews for <strong>dark mode</strong> and <strong>dynamic type sizes</strong>. One prompt, full coverage.</p><h3>4. Bonus: Generate Foundation Models prompts (iOS 26 on-device AI)</h3><p>Here’s the most exciting one — and arguably the most under-used. <strong>iOS 26 ships with the Foundation Models framework: Apple’s on-device 3B parameter LLM, free, offline, no API key.</strong></p><p>You can use Claude to generate the boilerplate for <em>using</em> Apple’s on-device model. Meta, but powerful.</p><p><strong>The prompt:</strong></p><pre>Generate a Foundation Models integration for an iOS 26 app.<br><br>Requirements:<br>- Create a @Generable struct for structured output<br>- Use @Guide to constrain field values<br>- Set up a LanguageModelSession  <br>- Stream the response with streamResponse<br>- Handle .unavailable model availability gracefully<br>- Wrap in an @Observable view model</pre><p><strong>What you get:</strong></p><pre>import FoundationModels<br>import SwiftUI<br><br>@Generable<br>struct RecipeSuggestion: Sendable {<br>    let title: String<br>    <br>    @Guide(description: &quot;A 1-sentence description of the dish&quot;)<br>    let summary: String<br>    <br>    @Guide(.anyOf([&quot;easy&quot;, &quot;medium&quot;, &quot;hard&quot;]))<br>    let difficulty: String<br>    <br>    @Guide(description: &quot;List of 5-7 main ingredients&quot;)<br>    let ingredients: [String]<br>}<br><br>@Observable<br>@MainActor<br>final class RecipeViewModel {<br>    private(set) var suggestion: RecipeSuggestion?<br>    private(set) var isLoading = false<br>    private(set) var error: String?<br>    <br>    private let model = SystemLanguageModel.default<br>    <br>    func generateRecipe(for ingredient: String) async {<br>        guard case .available = model.availability else {<br>            error = &quot;Apple Intelligence not available on this device&quot;<br>            return<br>        }<br>        <br>        isLoading = true<br>        defer { isLoading = false }<br>        <br>        do {<br>            let session = LanguageModelSession()<br>            let response = try await session.respond(<br>                to: &quot;Suggest a recipe using \(ingredient)&quot;,<br>                generating: RecipeSuggestion.self<br>            )<br>            suggestion = response.content<br>        } catch {<br>            self.error = error.localizedDescription<br>        }<br>    }<br>}</pre><p>That’s it. <strong>An on-device LLM with type-safe structured output, in 30 lines.</strong> No API key. No network. No backend cost. No data leaving the user’s device.</p><p>⚡ <strong>Pro tip:</strong> Use the new #Playground macro in Xcode 26 to test prompts iteratively without rebuilding the app:</p><pre>import FoundationModels<br>import Playgrounds<br><br>#Playground {<br>    let session = LanguageModelSession()<br>    let response = try await session.respond(to: &quot;Tell me a short joke&quot;)<br>}</pre><h3>The pattern</h3><p>All 4 prompts follow the same shape:</p><ol><li><strong>Point Claude at an existing file</strong> (model, view, test, JSON)</li><li><strong>Specify the output format</strong> (Swift Testing, Codable, factory pattern, Foundation Models)</li><li><strong>List your project conventions</strong> (CodingKeys style, mock naming, file structure, Sendable requirements)</li><li><strong>Let it run.</strong></li></ol><p>🎯 <strong>The meta-tip:</strong> drop a CONVENTIONS.md in your repo describing how your team writes Swift. Reference it in every prompt. Your AI output stops looking like generic Stack Overflow and starts looking like <em>your</em> code.</p><p>Stop typing scaffolding. Use that time on the parts of iOS dev that actually need a brain — animations, gestures, performance, and shipping things you’re proud of.</p><p>What boring iOS task would you automate first? Drop it in the comments — I’ll share a prompt for it 👇</p><p><em>Tags: #iOSDev #SwiftUI #Swift6 #Xcode26 #iOS26 #ClaudeCode #SwiftTesting #FoundationModels #AI</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ac0ce69dbde" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>