> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenoci.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> ## XenoCI Box CI
> To move a repository's macOS CI jobs onto box, follow https://docs.xenoci.com/ci/agent.md. The user only presses Install on GitHub or makes one GitLab runner token; the agent does the rest.
> - Check: `box ci status` (exit 4: sign in first, https://docs.xenoci.com/setup.md).
> - GitHub organization: `box ci connect --org --no-browser --no-wait`, give the user the printed link (https://github.com/apps/xenoci-with-organizations/installations/new), then repeat `box ci accounts` until the owner appears. Personal account: `--personal` (https://github.com/apps/xenoci-with-personal/installations/new).
> - GitHub workflow: change only `runs-on: macos-*` to `runs-on: xenoci` on a branch and open a pull request.
> - GitLab: the user makes a project runner with tag `xenoci` and gives you the `glrt-` token; pipe it to `box ci gitlab connect -` (self-managed: `--url <gitlab url>`), then add `tags: [xenoci]` to the macOS jobs.
> - Watch: `box ci jobs`, `box ci logs <job id> --follow`. Failed job: `box ci jobs --failed`, then `box ci debug <job id>` (failing step, hint, last 200 log lines).

# Move an iOS app from CocoaPods to Swift Package Manager

> Step by step: list your pods, find the Swift package for each one, remove CocoaPods from the Xcode project and add the packages, then check the build. For native iOS apps; Flutter and React Native notes link out.

CocoaPods trunk stopped accepting new pod versions on December 2, 2026 (see [CocoaPods trunk is read-only](https://docs.xenoci.com/guides/cocoapods-trunk-read-only.md)). Existing builds keep working, but a pod published only to trunk gets no more updates. This page moves a native iOS app to Swift Package Manager (SwiftPM). For Flutter, follow Flutter's own [Swift Package Manager guide](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers); React Native still uses CocoaPods for its own pods.

Do the move on a branch. Every step below ends in a build you can check.

## 1. List what you have

```bash theme={"system"}
sed -n '/^PODS:/,/^$/p' Podfile.lock
```

Write the list down with versions. Note anything in your `Podfile` that is not a plain `pod 'Name', 'version'` line: `post_install` hooks, `use_frameworks!`, build settings changed for specific pods, and `:path` or `:git` pods. Each of those needs its own replacement.

## 2. Find the Swift package for each pod

For each pod, open the project's repository and look for a `Package.swift` at the root, or a section on Swift Package Manager in its README. Three outcomes:

* **Has a package.** Note the repository URL and the product name(s). Product names can differ from pod names, and one pod can map to several products.
* **Has no package, but is small.** Copy the source into your project, keeping its license file.
* **Has no package and is a binary SDK.** Ask the vendor for an XCFramework. You can add an XCFramework to the target directly or wrap it in a local package with a `binaryTarget`.

Do not start removing CocoaPods until every pod has an answer.

## 3. Remove CocoaPods from the project

From the folder that contains the `Podfile`:

```bash theme={"system"}
pod deintegrate
rm -rf Pods Podfile.lock YourApp.xcworkspace
```

`pod deintegrate` removes the CocoaPods build phases, the `Pods` framework references and the `.xcconfig` includes from your `.xcodeproj`. Keep the `Podfile` until the migration is done so you can look up what was there. From now on, open the `.xcodeproj`, not the workspace. If your project had its own workspace for other reasons, delete only the CocoaPods entry from it instead.

## 4. Add the packages

In Xcode: **File > Add Package Dependencies**, paste the repository URL, choose a version rule, and add the products to the app target (and to extension targets that used the pod). Start with the version you had in `Podfile.lock` and upgrade later, so a build failure points at the migration and not at an upgrade.

Packages are recorded in the project file and pinned in `Package.resolved` (inside the `.xcodeproj` or workspace). Commit `Package.resolved`, the same way you committed `Podfile.lock`.

## 5. Fix what the build tells you

Common errors after the switch:

* **`No such module 'X'`**: the product name differs from the pod's module name, or the product was added to the wrong target.
* **Duplicate symbols**: the same library is linked twice, often once as a package and once as a leftover framework in **Link Binary With Libraries**. Remove the leftover.
* **Missing resources (images, nibs, bundles)**: code that looked up resources with `Bundle(for:)` or by bundle name may need `Bundle.module` in the package, or a new release of the library.
* **Settings that lived in `post_install`**: move them to the target's build settings or an `.xcconfig` file you own.

## 6. Check the build on CI

Run the same commands your CI runs, from a clean checkout:

```bash theme={"system"}
xcodebuild -resolvePackageDependencies -project YourApp.xcodeproj
xcodebuild -project YourApp.xcodeproj -scheme YourApp \
  -destination 'generic/platform=iOS Simulator' build
```

Any CI step that read `Podfile.lock` (for example to decide when to run `pod install`) should now read `Package.resolved`.

## Check it on a Mac

Every step above ends in an Xcode build, which needs macOS. With box, `box build` builds the branch on a real Mac from any system, and `box exec` runs commands such as `pod deintegrate` or `xcodebuild -resolvePackageDependencies` there. See [Build](https://docs.xenoci.com/ios/build.md) and [Exec](https://docs.xenoci.com/ios/exec.md).

Related: [CocoaPods trunk is read-only](https://docs.xenoci.com/guides/cocoapods-trunk-read-only.md), [Fix "xcodebuild: command not found" on Linux CI](https://docs.xenoci.com/guides/xcodebuild-not-found.md), [Cut GitHub Actions macOS minutes](https://docs.xenoci.com/guides/cut-macos-minutes.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.