Skip to main content
ClaudeWave
Skill732 repo starsupdated 15d ago

appmigrationkit

AppMigrationKit enables one-time cross-platform data transfer for iOS apps during device setup, allowing export to or import from Android or other platforms through a system-orchestrated extension. Use it when building an app migration extension, packaging resources with ResourcesArchiver, importing resources on destination devices, tracking migration progress, handling errors, checking migration status, or testing migration workflows on iOS 26.0 and later.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/dpearson2699/swift-ios-skills /tmp/appmigrationkit && cp -r /tmp/appmigrationkit/skills/appmigrationkit ~/.claude/skills/appmigrationkit
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# AppMigrationKit

One-time cross-platform data transfer for app resources. Enables apps to
export data to or import data from another platform (for example, Android)
during device setup or onboarding. AppMigrationKit APIs are iOS 26.0+ /
iPadOS 26.0+; the data-container entitlement is iOS 26.1+ / iPadOS 26.1+ /
Mac Catalyst 26.1+. Swift 6.3.

> **Beta-sensitive.** AppMigrationKit is new in iOS 26 and may change before GM.
> Re-check current Apple documentation before relying on specific API details.

AppMigrationKit uses an app extension model. The system orchestrates the
transfer between devices. The app provides an extension conforming to export
and import protocols, and the system calls that extension at the appropriate
time. The app itself never manages the network connection between devices.

## Contents

- [Architecture Overview](#architecture-overview)
- [Setup and Entitlements](#setup-and-entitlements)
- [App Migration Extension](#app-migration-extension)
- [Exporting Resources](#exporting-resources)
- [Importing Resources](#importing-resources)
- [Migration Status](#migration-status)
- [Progress Tracking](#progress-tracking)
- [Testing](#testing)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)

## Architecture Overview

AppMigrationKit operates through three layers:

1. **App extension** -- An `AppMigrationExtension` conforming type that the
   system invokes during migration. It handles data export and import.
2. **System orchestration** -- The OS manages the device-to-device session,
   transport, and scheduling. The extension does not control when it runs.
3. **Containing app** -- After migration completes, the app checks
   `MigrationStatus.importStatus` on first launch to determine whether
   migration occurred and whether it succeeded.

Key types:

| Type | Role |
|---|---|
| `AppMigrationExtension` | Protocol for the app extension entry point |
| `ResourcesExportingWithOptions` | Protocol for exporting files via archiver |
| `ResourcesExporting` | Simplified export protocol (no custom options) |
| `ResourcesImporting` | Protocol for importing files on the destination |
| `ResourcesArchiver` | Streams files into the export archive |
| `MigrationDataContainer` | Access to the containing app's data directories |
| `MigrationStatus` | Check import result from the containing app |
| `MigrationPlatform` | Identifies the other device's platform (e.g., `.android`) |
| `MigrationAppIdentifier` | Identifies the source app by store and bundle ID |
| `AppMigrationTester` | Test-only actor for validating export/import logic |

## Setup and Entitlements

### Entitlement

The app extension requires the `com.apple.developer.app-migration.data-container-access`
entitlement. Its value is a single-element string array containing the bundle
identifier of the containing app:

```xml
<key>com.apple.developer.app-migration.data-container-access</key>
<array>
    <string>com.example.myapp</string>
</array>
```

No other values are valid. This entitlement grants the extension read access
to the containing app's data container during export and write access during
import. The entitlement itself is available on iOS 26.1+, iPadOS 26.1+,
and Mac Catalyst 26.1+, even though the core AppMigrationKit APIs are
available on iOS 26.0+ and iPadOS 26.0+.

### Extension Target

Add a new App Extension target to the Xcode project. The extension conforms
to one or more of the migration protocols (`ResourcesExportingWithOptions`,
`ResourcesExporting`, `ResourcesImporting`).

## App Migration Extension

The extension entry point conforms to `AppMigrationExtension`. During
migration, the system prevents launching the containing app and its other
extensions to ensure exclusive data access.

### Accessing the Data Container

The extension accesses the containing app's files through `appContainer`:

```swift
import AppMigrationKit

struct MyMigrationExtension: ResourcesExporting {
    var resourcesSizeEstimate: Int { estimateTotalExportSize() }
    var resourcesVersion: String { "1.0" }
    var resourcesCompressible: Bool { true }

    func exportResources(
        to archiver: sending ResourcesArchiver,
        request: MigrationRequest
    ) async throws {
        let container = appContainer

        // container.bundleIdentifier     -- app's bundle ID
        // container.containerRootDirectory -- root of the app container
        // container.documentsDirectory    -- Documents/
        // container.applicationSupportDirectory -- Application Support/
    }
}
```

`MigrationDataContainer` provides `containerRootDirectory`, `documentsDirectory`,
and `applicationSupportDirectory` as `URL` values pointing into the containing
app's sandbox.

## Exporting Resources

Conform to `ResourcesExportingWithOptions` (or `ResourcesExporting` for no
custom options) to package files for transfer. The system calls
`exportResources(to:request:)` with a `ResourcesArchiver` and a
`MigrationRequestWithOptions`.

### Declaring Export Properties

```swift
struct MyMigrationExtension: ResourcesExportingWithOptions {
    typealias OptionsType = MigrationDefaultSupportedOptions

    var resourcesSizeEstimate: Int {
        // Return estimated total bytes of exported data
        calculateExportSize()
    }

    var resourcesVersion: String {
        "1.0"
    }

    var resourcesCompressible: Bool {
        true  // Let the system compress during transport
    }
}
```

- `resourcesSizeEstimate` -- Estimated total bytes. The system uses this for
  progress UI and free-space checks.
- `resourcesVersion` -- Format version string. The import side receives this
  to handle versioned data formats.
- `resourcesCompressible` -- When `true`, the archiver may compress files
  during transport.

### Implementing Export

```swift
func exportResources(
    to archiver: sending ResourcesArchiver,
    request: MigrationRequestWithOptions<MigrationDefaultSupportedOptions>
) async throws {
    let
accessorysetupkitSkill

Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions.

activitykitSkill

Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for the Lock Screen and Dynamic Island — delivery tracking, sports scores, ride-sharing status, workout timers, media playback, or any time-sensitive information that updates in real time. Also use when working with ActivityKit, ActivityAttributes, Activity lifecycle (request/update/end), Dynamic Island layouts (compact/minimal/expanded), push-to-update Live Activities, or Lock Screen live widgets.

adattributionkitSkill

Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.

alarmkitSkill

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, AlarmButton stop and snooze actions, authorization, state observation, countdown widget-extension handoff, and Live Activity integration. Use when building wake-up alarms, countdown timers, or alarm-style alerts that need Apple's system alarm experience.

app-clipsSkill

Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store Connect experiences, size/capability constraints, NSUserActivity routing, SKOverlay promotion, App Group/keychain handoff, ephemeral notifications, location confirmation, and full-app migration. Use when creating App Clips or wiring App Clip invocation, experience configuration, or full-app handoff.

app-intentsSkill

Implement App Intents for Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence on iOS. Covers AppIntent actions, AppEntity and EntityQuery models, AppShortcutsProvider phrases, IndexedEntity Spotlight indexing, WidgetConfigurationIntent, SnippetIntent, and assistant schemas. Use when exposing app actions or entities to system surfaces.

app-store-optimizationSkill

Optimize App Store product pages for search visibility and conversion. Use for App Store Optimization (ASO), keyword research, app name/subtitle/keyword-field strategy, conversion-focused descriptions and promotional text, screenshot captions and ordering, Custom Product Pages with assigned search keywords, In-App Events, Product Page Optimization tests, localized metadata, ratings/review strategy, and in-app review prompt timing with RequestReviewAction or AppStore.requestReview. Also use when routing ASO vs App Store review, privacy/ATT, or StoreKit implementation boundaries.

app-store-reviewSkill

Prepare for App Store review and prevent rejections. Covers App Store review guidelines, app rejection reasons, PrivacyInfo.xcprivacy privacy manifest requirements, required API reason codes, in-app purchase IAP and StoreKit rules, App Store Guidelines compliance, ATT App Tracking Transparency, EU DMA Digital Markets Act, HIG compliance checklist, app submission preparation, review preparation, metadata requirements, entitlements, widgets, and Live Activities review rules. Use when preparing for App Store submission, fixing rejection reasons, auditing privacy manifests, implementing ATT consent flow, configuring StoreKit IAP, or checking HIG compliance.