Skip to content

commandMobileswift

Fix iOS Build

Diagnoses an Xcode build or code signing failure from the error output and applies the smallest fix that makes it build.

npx workspacetemplates add fix-ios-build --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/fix-ios-build.md17 lines · 1.2 KBFile
---
description: Diagnoses an Xcode build or code signing failure from the error output and applies the smallest fix that makes it build.
argument-hint: "[scheme name or pasted error]"
---

Fix the iOS build failure. Scheme or error text: $ARGUMENTS

1. Find the project: `ls *.xcworkspace *.xcodeproj`. Prefer the workspace. List schemes with `xcodebuild -list`.
2. Reproduce: `xcodebuild -scheme <scheme> -destination 'generic/platform=iOS Simulator' build 2>&1 | tail -n 80`. If the user pasted an error, start from it but still reproduce.
3. Find the first "error:" line, not the last. Classify it:
   - Compiler: open the file and fix the code.
   - Dependency: check Package.resolved, Podfile.lock and the minimum deployment target.
   - Signing: compare the bundle id, team and profile with `security find-identity -v -p codesigning` and the target's signing settings.
   - Linker: look for missing frameworks, duplicate symbols, architecture exclusions.
4. Apply the smallest fix and rebuild. Stop after three failed attempts and report what you learned.

Do not delete DerivedData, change the team, or edit certificates or profiles without asking. Report the cause, the change, and the build result.

What it does

Xcode errors are long and the real cause is often buried near the top. This command runs the build from the terminal, reads the first genuine error and separates compiler issues, dependency problems and signing mismatches.

It fixes source and project settings that are safely reversible, and asks before touching certificates, profiles or anything in your keychain.

Example

you › /fix-ios-build Release

agent › First error: "No profile for team matching com.acme.app" in the Release configuration. Debug uses automatic signing but Release is manual with an expired profile name. Switch Release to automatic signing for team ABCDE12345?

Questions

Will it change my certificates?
No. It inspects what is installed and asks before any signing change.
Does it need a Mac?
Yes, xcodebuild only runs on macOS with Xcode installed.
  • Check Android Lint

    Commandkotlin

    Free
  • Flutter State Management

    Skillflutter

    Free
  • Kotlin Android Compose

    Skillkotlin

    Free
  • Mobile App Release

    SkillMobile

    Free