xcframework-build
/xcframework-build
Build, verify, sign and zip XCFrameworks from Swift packages or Xcode projects, driven by an xcframework.json config (platforms, static or dynamic linkage, deployment targets, dependencies between frameworks, signing, hooks). Use when the user wants to ship a binary SDK or framework, convert a Swift package to an .xcframework, set up or fix a build-xcframework script, or debug a broken xcframework (missing swiftmodule, "no such module", duplicate classes, invalid signature, __MACOSX in the zip, leaked source paths). Triggers - xcframework, binary framework, binaryTarget, BUILD_LIBRARY_FOR_DIST
- Author
- anvyxhq ↗
- Repository
- xcframework-skill ↗
- Licence
- MIT
- Last repository change
- 13.11.2026
Assessment and security
- Files in this package
- 11
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/xcfbuild.py
What it does and when to use it
Build, verify, sign and zip XCFrameworks from Swift packages or Xcode projects, driven by an xcframework.json config (platforms, static or dynamic linkage, deployment targets, dependencies between frameworks, signing, hooks). Use when the user wants to ship a binary SDK or framework, convert a Swift package to an .xcframework, set up or fix a build-xcframework script, or debug a broken xcframework (missing swiftmodule, "no such module", duplicate classes, invalid signature, __MACOSX in the zip, leaked source paths). Triggers - xcframework, binary framework, binaryTarget, BUILD_LIBRARY_FOR_DIST
Triggers from the description
Original author description
Build, verify, sign and zip XCFrameworks from Swift packages or Xcode projects, driven by an xcframework.json config (platforms, static or dynamic linkage, deployment targets, dependencies between frameworks, signing, hooks). Use when the user wants to ship a binary SDK or framework, convert a Swift package to an .xcframework, set up or fix a build-xcframework script, or debug a broken xcframework (missing swiftmodule, "no such module", duplicate classes, invalid signature, __MACOSX in the zip, leaked source paths). Triggers - xcframework, binary framework, binaryTarget, BUILD_LIBRARY_FOR_DIST
How it works
- Workflow
- What the tool does for you
- Failures and fixes
- Project-specific steps
- Limits
SKILL.md preview
---
name: xcframework-build
description: Build, verify, sign and zip XCFrameworks from Swift packages or Xcode projects, driven by an xcframework.json config (platforms, static or dynamic linkage, deployment targets, dependencies between frameworks, signing, hooks). Use when the user wants to ship a binary SDK or framework, convert a Swift package to an .xcframework, set up or fix a build-xcframework script, or debug a broken xcframework (missing swiftmodule, "no such module", duplicate classes, invalid signature, __MACOSX in the zip, leaked source paths). Triggers - xcframework, binary framework, binaryTarget, BUILD_LIBRARY_FOR_DISTRIBUTION, swiftinterface, đóng gói SDK, build xcframework.
---
# Build XCFrameworks
`scripts/xcfbuild.py` builds every framework listed in `xcframework.json`, checks the result, then signs
and zips it. It needs only Xcode and the system `python3`. Paths below are relative to this skill folder.
## Workflow
1. **Find what to build.** If the machine is new to you, `python3 scripts/xcfbuild.py doctor` first: it
lists the Xcode versions, SDKs and certificates that can really sign. Then run
`python3 scripts/xcfbuild.py init <project dir>`. It prints a starter config
with one entry per library product and the `dependsOn` links between local packages. For an Xcode
project, add `{"name": ..., "project": ..., "scheme": ...}` by hand.
2. **Find out how the binary is delivered, then write `xcframework.json`** in the project root. Look
first, ask second: the repo usually answers (a `Podfile` or `*.podspec` means CocoaPods; a package
with a `binaryTarget` means Swift Package Manager; a script that copies a folder to customers means
manual delivery). Ask the user for what the code cannot tell you, in one message:
| Question | Config it decides |
| --- | --- |
| How do integrators add the framework: Swift Package Manager, CocoaPods, both, or a zip they add by hand? | `wrapperDir` (SwiftPM), `podspec` (CocoaPods), neither (zip only) |
| For CocoaPods or a remote `binaryTarget`: at which URL will the zip be hosted? | `podspec.source`; the printed checksum |
| Which platforms, and static or dynamic? | `platforms`, `linkage` |
| Third-party libraries the code imports: ship them inside the framework, or does the app add them? | `externalDependencies` (the app adds them; needs static linkage for source packages) |
| Which bundle id prefix and version? | `bundleIdPrefix`, `version` |
| Sign it? With which certificate? | `sign` |
Do not add `wrapperDir` or `podspec` the user did not ask for: each one writes files they then have
to maintain. `references/config.md` lists every option; `examples/xcframework.json` is a full example.
3. **Check the plan.** `python3 scripts/xcfbuild.py plan` prints build order and settings and reports
config mistakes without building.
4. **Build.** `python3 scripts/xcfbuild.py build` (add `--only NAME` for one framework and its
dependencies, `--version X` to override the version). Each archive takes 10-60 s per platform; run it
in the background for many platforms. A framework whose sources and settings did not change is
not rebuilt (`up to date, not rebuilt`); pass `--rebuild` when something outside the package
folders changed, and `--verbose` to watch `xcodebuild`.
5. **Read the verify report.** Every `FAIL` line stops the build before signing and names the cause. Fix
the cause in the source or the config; do not turn a check off to get a green build. The table below
maps each failure to its fix.
6. **Report the result**: zip paths, checksums (for a remote `binaryTarget`), signed or unsigned, and
every warning that remains. Output goes to `build/xcframeworks/` next to the config unless
`outputDir` or `--output-dir` says otherwise; "Output" in `references/config.md` covers the
location rules and what happens when a build is already there.
To check an xcframework that something else built: `python3 scripts/xcfbuild.py verify <path>`, and
`python3 scripts/xcfbuild.py smoke <path> [its dependencies...]` to link it into a throwaway consumer.
Set `wrapperDir` when the user ships the binary as a Swift package and `podspec` when they ship it
through CocoaPods ("Wrapper package" and "CocoaPods" in `references/config.md`). The tool writes the
podspec; uploading the zip and `pod trunk push` or pushing to a private spec repo are the user's steps:
they publish outside the machine, so do them only when the user asks.
## What the tool does for you
Do not re-implement these by hand; they are the steps people get wrong.
- Builds a **copy** of each package under another folder name and changes only that copy: library type,
deployment targets, and each `dependsOn` package replaced by a `binaryTarget` on the xcframework built
one step earlier. The user's `Package.swift` is never edited.
- Copies the Swift module into the framework (a SwiftPM archive leaves it outside) and the resource
bundles to where `Bundle.module` looks for them.
- For static linkage, archives all object files of the product into a static framework and writes its
Info.plist from the binary's real minimum OS.
- Removes files that leak source paths or non-public API, sets bundle ids, strips symbols, re-signs
linker-signed slices it changed.
- Edits first, signs second, zips last, without Finder metadata.
## Failures and fixes
| Verify or build message | Cause | Fix |
| --- | --- | --- |
| `public interface imports [X], which are not shipped` / `no such module 'X'` | A public file imports an internal target; the interface repeats the import | `internal import X` in the source (Swift 6 compiler) or `@_implementationOnly import X`; or add X to the config as its own framework |
| `contains code of X ... linked in from source` | The framework was built against X's source, so X is inside it | Add `"dependsOn": ["X"]`; X must be a framework in the config |
| `links frameworks not declared in dependsOn` | A dependency is missing from the config | Add it to `dependsOn` if this config builds it, to `externalDependencies` if somebody else provides it |
| `X is in externalDependencies, but its code is in the binary` | A dynamic framework links source dependencies in | Static linkage, or depend on X as a binary |
| `an app that imports [...] does not build` | The consumer test failed to compile or link; the lines below name the symbols | `Undefined symbols`: code is missing from a static archive or a dependency is not listed. `duplicate symbol`: two frameworks contain the same code, split it out with `dependsOn` |
| `references code of [X] that is not in the binary` | A static archive lacks an internal target's objects | Rebuild with this tool; if it persists the target is excluded from the product |
| `.swiftinterface does not type-check` | The interface cannot be loaded by consumers; often a type named like its module, or a missing import | Read the compiler lines under the message; fix the source |
| `must not ship: ...abi.json` etc. | Verifying an xcframework built elsewhere | Rebuild with this tool, or delete the files **before** signing |
| `configured A, but the toolchain raised the minimum OS to B` | The Xcode in use no longer supports A | Set `deploymentTargets` to B, or pin an older Xcode with `"xcode"` |
| `Info.plist ... != binary minimum OS` | Plist written by hand with a guessed value | Rebuild with this tool |
| `signature invalid` | Something changed the xcframework after signing | Do every edit in a `beforeSign` hook, never later |
| `the interface records experimental features` (warning) | The manifest's `swiftSettings` reach the distribution build | `"dropSwiftSettings": true` |
| `no scheme builds product X` | The package does not expose X as a library product | Check `products:` in Package.swift |
| `no certificate matching ... can sign` | No usable certificate, or its intermediate is missing | Install the intermediate certificate, or set `sign.identity` to a hash from `security find-identity -v -p codesigning` |
| `static framework with resource bundle` (warning) | Static code looks for its bundle in the app's main bundle | Tell the user: the app must copy the bundle, or switch to dynamic |
| `the build-only manifest override does not compile` | Toolchain too old for the override code | Use Xcode 15 or newer, or `"xcode"` to pick one |
| archive fails | Compile error in the package for that platform | The message shows the compiler errors and the log path; the work dir is kept |
`references/gotchas.md` explains why each rule exists and covers cases the tool cannot check.
## Project-specific steps
Keep them out of the tool. Put them in hooks (`afterSlice`, `beforeSign`, `afterPackage`) that call the
project's own scripts: obfuscation checks, asset or model checks, building the customer delivery folder,
upload. A hook that exits non-zero stops the build.
## Limits
- One framework = one library product whose name equals a Swift target name. Products that expose C or
Objective-C headers are not handled.
- `dependsOn` links package frameworks of the same config. Other dependencies are compiled into the
framework (the tool warns) unless they are listed in `externalDependencies`. Two products of **one** package that
share a target each get a copy of that target; move the shared target to its own package.
- Checked on Xcode 27.2 (and a full package build on Xcode 26.6 through `"xcode": "26"`) with Swift packages: all ten platforms dynamic; iOS, iOS Simulator and macOS
static; resources loaded at run time on macOS; a package whose name differs from its product; an
internal C target; several products in one package; generated podspecs pass `pod spec lint`
(CocoaPods 1.16.2). Also checked: Xcode project sources (dynamic and
static), `debugSymbols`, wrapper packages, external dependencies. Not yet checked: workspace sources,
remote external dependencies, signing with a secure timestamp, an app on an iOS device or simulator,
static resources inside an Xcode-built app, the example CI workflow. Say so if
the user relies on one of them, and test it on their project first.
Files in this package (11)
- .gitignore 1 KB
- LICENSE 1 KB
- README.md 11 KB
- README.vi.md 12 KB
- SKILL.md 10 KB
- config.schema.json 18 KB
- examples/github-release.yml 1 KB
- examples/xcframework.json 1 KB
- references/config.md 18 KB
- references/gotchas.md 14 KB
- scripts/xcfbuild.py 109 KB
Versions
The database has no other skills named xcframework-build.
Database snapshot: 13.11.2026 · package version b21fda6065de (SHA-256 digest of the entire package)
Downloads in the last 30 days: 3 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100swift-package-manager
Swift Package Manager (SPM) for iOS/Swift dependencies - the Package.swift manifest (swift-tools-version, PackageDescription), declaring dependencies with version rules (from, upToNextMinor, exact, ranges, branch/revision), defining targets and products (library/executable),… - 100expo-brownfield
Integrate Expo and React Native into an existing native iOS or Android app. Use when the user mentions brownfield, embedding React Native in a native app, AAR/XCFramework, or adding Expo to an existing Kotlin/Swift project. Covers both the isolated approach and the integrated approach. - 100expo-brownfield
Integrate Expo and React Native into an existing native iOS or Android app. Use when the user mentions brownfield, embedding React Native in a native app, AAR/XCFramework, or adding Expo to an existing Kotlin/Swift project. Covers both the isolated approach and the integrated approach. - 100expo-brownfield
Integrate Expo and React Native into an existing native iOS or Android app. Use when the user mentions brownfield, embedding React Native in a native app, AAR/XCFramework, or adding Expo to an existing Kotlin/Swift project. Covers both the isolated approach and the integrated approach. - 100macos-spm-app-packaging
Turns a Swift Package Manager executable into a real macOS .app without an Xcode project: builds the binary, assembles the bundle and Info.plist, signs it, and for distribution notarizes, staples and wraps it in a zip or disk image. Covers universal binaries, resources and… - 100kotlin-tooling-native-build-performance
Diagnoses and fixes slow Kotlin/Native compilation and linking in Kotlin Multiplatform projects that target iOS. Use when the user reports slow iOS or shared-framework builds, long linkDebug*/linkRelease* or XCFramework tasks, cold CI builds that re-download the Kotlin/Native…