capacitor-app-spm-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCapacitor App: CocoaPods → SPM Migration
Capacitor应用:从CocoaPods迁移至SPM
Migrate an existing Capacitor app project's iOS dependency management from CocoaPods to Swift Package Manager (SPM). The migration is destructive — the existing folder is deleted and re-scaffolded, then user-authored files are restored from a temporary backup.
ios/将现有Capacitor应用项目的iOS依赖管理从CocoaPods迁移到Swift Package Manager(SPM)。该迁移具有破坏性——会删除现有文件夹并重新搭建,之后从临时备份恢复用户编写的文件。
ios/Prerequisites
前置条件
| Requirement | Version |
|---|---|
| Capacitor | 6+ |
| Node.js | 18+ |
| Xcode | 15+ |
| CocoaPods | installed (only used for verification before deletion) |
The project must be a Capacitor app (not a plugin) and must currently use CocoaPods ( exists).
ios/App/Podfile| 要求 | 版本 |
|---|---|
| Capacitor | 6+ |
| Node.js | 18+ |
| Xcode | 15+ |
| CocoaPods | 已安装(仅用于删除前的验证) |
项目必须是Capacitor app(而非插件),且当前使用CocoaPods(存在文件)。
ios/App/PodfileProcedures
操作步骤
Step 1: Verify Project State
步骤1:验证项目状态
- Verify the project is a Capacitor app, not a plugin. Confirm lists
package.jsonin@capacitor/iosand the project root contains adependenciesfile.capacitor.config.* - Verify the project currently uses CocoaPods. The file must exist. If it does not exist and
ios/App/Podfileexists, the project is already on SPM — abort and inform the user.ios/App/CapApp-SPM/Package.swift - Read version from
@capacitor/core(package.jsonordependencies). Confirm the major version is 6 or higher. If lower, abort and direct the user to thedevDependenciesskill first.capacitor-app-upgrades - Verify the working tree is clean. Run — if the output is non-empty, instruct the user to commit or stash changes before proceeding. The migration is destructive and must be reversible via
git status --porcelain.git checkout
- 验证项目为Capacitor app,而非插件。确认的
package.json中包含dependencies,且项目根目录存在@capacitor/ios文件。capacitor.config.* - 验证项目当前使用CocoaPods。必须存在文件。若该文件不存在,但存在
ios/App/Podfile,则项目已采用SPM——终止操作并告知用户。ios/App/CapApp-SPM/Package.swift - 从的
package.json或dependencies中读取devDependencies版本。确认主版本为6或更高。若版本较低,终止操作并引导用户先使用@capacitor/core技能进行升级。capacitor-app-upgrades - 验证工作树已清理。运行——若输出非空,指导用户在继续前提交或暂存更改。迁移具有破坏性,必须可通过
git status --porcelain撤销。git checkout
Step 2: Inventory Installed Capacitor Plugins
步骤2:盘点已安装的Capacitor插件
Read and record every installed Capacitor plugin under . Match these prefixes:
package.jsondependencies- (official plugins)
@capacitor/* - and
@capawesome/*@capawesome-team/* @capacitor-community/*@capacitor-firebase/*@capacitor-mlkit/*@revenuecat/*- Any other package with in its
"capacitor"package.jsonarraykeywords
Record each plugin's package name and installed version. This list is used in Step 8 to verify all plugins resolve under SPM after re-sync.
读取,记录下所有已安装的Capacitor插件。匹配以下前缀:
package.jsondependencies- (官方插件)
@capacitor/* - 和
@capawesome/*@capawesome-team/* @capacitor-community/*@capacitor-firebase/*@capacitor-mlkit/*@revenuecat/*- 其他在的
package.json数组中包含keywords的包"capacitor"
记录每个插件的包名和已安装版本。此列表将用于步骤8,以验证重新同步后所有插件均可在SPM下解析。
Step 3: Identify Files to Preserve
步骤3:确定需保留的文件
Build a checklist of files in that contain user-authored content and must survive the re-scaffold. For each path below, check whether the file exists. Record only the paths that exist.
ios/| Path (relative to project root) | Purpose |
|---|---|
| App permissions, URL schemes, bundle config, custom keys |
| Custom app lifecycle code |
| Custom scene lifecycle code (if present) |
| App icon, splash assets, color sets |
| LaunchScreen and Main storyboards |
| Push, App Groups, Associated Domains, Keychain Sharing |
| Firebase configuration (if Firebase plugins are installed) |
| Build configuration overrides |
| Source for extracting signing values in Step 5 |
Additionally, scan for any other files beyond and . These are user-authored Swift sources (e.g., custom Notification Service Extensions, custom view controllers) and must also be preserved.
ios/App/App/.swiftAppDelegate.swiftSceneDelegate.swiftIf the project contains a Notification Service Extension or other Xcode targets under (e.g., ), record those directories as well.
ios/App/ios/App/NotificationService/列出目录中包含用户自定义内容、需在重新搭建后保留的文件清单。检查以下每个路径是否存在,仅记录存在的路径。
ios/| 路径(相对于项目根目录) | 用途 |
|---|---|
| 应用权限、URL Scheme、Bundle配置、自定义键 |
| 自定义应用生命周期代码 |
| 自定义场景生命周期代码(若存在) |
| 应用图标、启动页资源、颜色集 |
| 启动页和主故事板 |
| 推送通知、App Groups、关联域名、钥匙串共享 |
| Firebase配置(若安装了Firebase插件) |
| 构建配置覆盖项 |
| 用于步骤5提取签名值的源文件 |
此外,扫描目录中除和外的所有其他文件。这些是用户编写的Swift源码(例如自定义通知服务扩展、自定义视图控制器),也需保留。
ios/App/App/AppDelegate.swiftSceneDelegate.swift.swift若项目包含通知服务扩展或下的其他Xcode目标(例如),也需记录这些目录。
ios/App/ios/App/NotificationService/Step 4: Back Up Preserved Files
步骤4:备份需保留的文件
-
Create the backup directory:bash
mkdir -p .spm-migration-backup -
Addto
.spm-migration-backup/to prevent accidental commits:.gitignorediff# iOS files +.spm-migration-backup/ -
Copy each file recorded in Step 3 into, preserving the relative path. For example:
.spm-migration-backup/bashmkdir -p .spm-migration-backup/ios/App/App cp ios/App/App/Info.plist .spm-migration-backup/ios/App/App/Info.plist cp ios/App/App/AppDelegate.swift .spm-migration-backup/ios/App/App/AppDelegate.swift cp -R ios/App/App/Assets.xcassets .spm-migration-backup/ios/App/App/Assets.xcassets cp -R ios/App/App/Base.lproj .spm-migration-backup/ios/App/App/Base.lprojRepeat for every file/directory identified in Step 3. Usefor directories.cp -R -
Always copy the fullto
ios/App/App.xcodeproj/project.pbxproj, even though the file itself will not be restored. Step 5 reads it to extract signing values, and Step 11 may reference it for capability reconfiguration..spm-migration-backup/ios/App/App.xcodeproj/project.pbxproj
-
创建备份目录:bash
mkdir -p .spm-migration-backup -
将添加到
.spm-migration-backup/中,防止意外提交:.gitignorediff# iOS files +.spm-migration-backup/ -
将步骤3中记录的每个文件复制到,保留相对路径。例如:
.spm-migration-backup/bashmkdir -p .spm-migration-backup/ios/App/App cp ios/App/App/Info.plist .spm-migration-backup/ios/App/App/Info.plist cp ios/App/App/AppDelegate.swift .spm-migration-backup/ios/App/App/AppDelegate.swift cp -R ios/App/App/Assets.xcassets .spm-migration-backup/ios/App/App/Assets.xcassets cp -R ios/App/App/Base.lproj .spm-migration-backup/ios/App/App/Base.lproj对步骤3中识别的每个文件/目录重复此操作。目录使用命令。cp -R -
务必将完整的复制到
ios/App/App.xcodeproj/project.pbxproj,即使该文件本身不会被恢复。步骤5会读取它来提取签名值,步骤11可能会参考它重新配置功能。.spm-migration-backup/ios/App/App.xcodeproj/project.pbxproj
Step 5: Extract Signing & Bundle Configuration
步骤5:提取签名与Bundle配置
Read and extract the values of the following build settings from the target's blocks (both and ). Search for each key and record the assigned value:
.spm-migration-backup/ios/App/App.xcodeproj/project.pbxprojAppXCBuildConfigurationDebugReleasePRODUCT_BUNDLE_IDENTIFIERDEVELOPMENT_TEAM- (e.g.,
CODE_SIGN_STYLEorAutomatic)Manual - (only if
PROVISIONING_PROFILE_SPECIFIER)CODE_SIGN_STYLE = Manual - (only if
CODE_SIGN_IDENTITY)CODE_SIGN_STYLE = Manual MARKETING_VERSIONCURRENT_PROJECT_VERSIONIPHONEOS_DEPLOYMENT_TARGETSWIFT_VERSION
Also record the list of capabilities by reading (if present). Note all top-level keys (e.g., , , ).
.spm-migration-backup/ios/App/App/App.entitlementsaps-environmentcom.apple.security.application-groupscom.apple.developer.associated-domainsSave the extracted values in memory for use in Step 9.
读取,从目标的块(和均需)中提取以下构建设置的值。搜索每个键并记录其赋值:
.spm-migration-backup/ios/App/App.xcodeproj/project.pbxprojAppXCBuildConfigurationDebugReleasePRODUCT_BUNDLE_IDENTIFIERDEVELOPMENT_TEAM- (例如
CODE_SIGN_STYLE或Automatic)Manual - (仅当
PROVISIONING_PROFILE_SPECIFIER时)CODE_SIGN_STYLE = Manual - (仅当
CODE_SIGN_IDENTITY时)CODE_SIGN_STYLE = Manual MARKETING_VERSIONCURRENT_PROJECT_VERSIONIPHONEOS_DEPLOYMENT_TARGETSWIFT_VERSION
同时,通过读取(若存在)记录功能列表。记录所有顶级键(例如、、)。
.spm-migration-backup/ios/App/App/App.entitlementsaps-environmentcom.apple.security.application-groupscom.apple.developer.associated-domains将提取的值保存到内存中,供步骤9使用。
Step 6: Delete the ios/
Folder
ios/步骤6:删除ios/
文件夹
ios/Confirm with the user that the working tree is committed (re-run if necessary) and that contains every file from Step 3. Then run:
git status --porcelain.spm-migration-backup/bash
rm -rf ios确认用户已提交工作树(必要时重新运行),且包含步骤3中的所有文件。然后运行:
git status --porcelain.spm-migration-backup/bash
rm -rf iosStep 7: Re-scaffold iOS with SPM
步骤7:使用SPM重新搭建iOS项目
Run:
bash
npx cap add ios --packagemanager SPMThis creates a new directory with the SPM-based scaffold. The new structure includes instead of .
ios/ios/App/CapApp-SPM/Package.swiftios/App/Podfile运行:
bash
npx cap add ios --packagemanager SPM此命令会创建新的目录,基于SPM搭建项目。新结构包含,而非。
ios/ios/App/CapApp-SPM/Package.swiftios/App/PodfileStep 8: Restore Preserved Files
步骤8:恢复备份文件
Copy each backed-up file from back to its original path under , overwriting the scaffolded defaults. For example:
.spm-migration-backup/ios/bash
cp .spm-migration-backup/ios/App/App/Info.plist ios/App/App/Info.plist
cp .spm-migration-backup/ios/App/App/AppDelegate.swift ios/App/App/AppDelegate.swift
cp -R .spm-migration-backup/ios/App/App/Assets.xcassets ios/App/App/Assets.xcassets
cp -R .spm-migration-backup/ios/App/App/Base.lproj ios/App/App/Base.lprojRepeat for every file/directory backed up in Step 4, except — that file is not restored. The new is required for SPM integration; signing values from the old one are reapplied via Step 9.
ios/App/App.xcodeproj/project.pbxprojproject.pbxprojIf any preserved file did not exist in the new scaffold (e.g., , , custom Swift files), the file must additionally be added to the Xcode project membership in Step 10.
App.entitlementsGoogleService-Info.plist将中的每个备份文件复制回下的原路径,覆盖搭建生成的默认文件。例如:
.spm-migration-backup/ios/bash
cp .spm-migration-backup/ios/App/App/Info.plist ios/App/App/Info.plist
cp .spm-migration-backup/ios/App/App/AppDelegate.swift ios/App/App/AppDelegate.swift
cp -R .spm-migration-backup/ios/App/App/Assets.xcassets ios/App/App/Assets.xcassets
cp -R .spm-migration-backup/ios/App/App/Base.lproj ios/App/App/Base.lproj对步骤4中备份的每个文件/目录重复此操作,除了——该文件不恢复。新的是SPM集成所必需的;旧文件中的签名值将通过步骤9重新应用。
ios/App/App.xcodeproj/project.pbxprojproject.pbxproj若某些备份文件在新搭建的项目中不存在(例如、、自定义Swift文件),则需在步骤10中将这些文件添加到Xcode项目成员中。
App.entitlementsGoogleService-Info.plistStep 9: Reapply Signing & Bundle Configuration
步骤9:重新应用签名与Bundle配置
Edit the new and reapply the values extracted in Step 5. For each setting, find every occurrence in the target's blocks and replace the scaffolded value with the recorded value.
ios/App/App.xcodeproj/project.pbxprojAppXCBuildConfigurationApply this diff pattern for each setting (example for ):
PRODUCT_BUNDLE_IDENTIFIERdiff
- PRODUCT_BUNDLE_IDENTIFIER = com.example.app;
+ PRODUCT_BUNDLE_IDENTIFIER = <RECORDED_BUNDLE_ID>;Settings to reapply (use semantics — update all occurrences across and configurations):
replace_allDebugReleasePRODUCT_BUNDLE_IDENTIFIERDEVELOPMENT_TEAMCODE_SIGN_STYLE- (only if manual signing)
PROVISIONING_PROFILE_SPECIFIER - (only if manual signing)
CODE_SIGN_IDENTITY MARKETING_VERSIONCURRENT_PROJECT_VERSION
If in the recorded values is higher than the scaffolded value, update it. If lower, keep the scaffolded value (the new scaffold targets a supported minimum).
IPHONEOS_DEPLOYMENT_TARGET编辑新的,重新应用步骤5中提取的值。对于每个设置,找到目标的块中的所有匹配项,将搭建生成的值替换为记录的值。
ios/App/App.xcodeproj/project.pbxprojAppXCBuildConfiguration对每个设置应用以下差异模式(以为例):
PRODUCT_BUNDLE_IDENTIFIERdiff
- PRODUCT_BUNDLE_IDENTIFIER = com.example.app;
+ PRODUCT_BUNDLE_IDENTIFIER = <RECORDED_BUNDLE_ID>;需重新应用的设置(使用语义——更新和配置中的所有匹配项):
replace_allDebugReleasePRODUCT_BUNDLE_IDENTIFIERDEVELOPMENT_TEAMCODE_SIGN_STYLE- (仅手动签名时)
PROVISIONING_PROFILE_SPECIFIER - (仅手动签名时)
CODE_SIGN_IDENTITY MARKETING_VERSIONCURRENT_PROJECT_VERSION
若记录的值高于搭建生成的值,则更新它。若低于,则保留搭建生成的值(新搭建的项目针对受支持的最低版本)。
IPHONEOS_DEPLOYMENT_TARGETStep 10: Add Restored Custom Files to the Xcode Project
步骤10:将恢复的自定义文件添加到Xcode项目
The new only references files that the scaffold created. Files restored in Step 8 that did not exist in the scaffold (e.g., , , custom Swift files, Notification Service Extension targets) are present on disk but invisible to Xcode until they are added to the project's , , and entries.
project.pbxprojApp.entitlementsGoogleService-Info.plistPBXBuildFilePBXFileReferencePBXGroupFor each custom file that was not part of the scaffold, instruct the user to perform the following one-time action in Xcode (the SPM scaffold has no — open directly):
App.xcworkspaceApp.xcodeproj- Open the project: (or
npx cap open ios).open ios/App/App.xcodeproj - In the Xcode Project Navigator, right-click the group and choose Add Files to "App"….
App - Select each restored custom file (e.g., ,
App.entitlements, customGoogleService-Info.plistfiles)..swift - Ensure Copy items if needed is unchecked and the target is checked.
App
For the file specifically, also set the build setting in . Apply this diff pattern in both and blocks for the target:
App.entitlementsCODE_SIGN_ENTITLEMENTSios/App/App.xcodeproj/project.pbxprojDebugReleaseXCBuildConfigurationAppdiff
CODE_SIGN_STYLE = Automatic;
+ CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CURRENT_PROJECT_VERSION = 1;If the project had additional Xcode targets (e.g., a Notification Service Extension under ), the user must recreate those targets in Xcode. SPM scaffolding does not regenerate non- targets. Inform the user explicitly.
ios/App/NotificationService/App新的仅引用搭建生成的文件。步骤8中恢复的、不属于搭建内容的文件(例如、、自定义Swift文件、通知服务扩展目标)已存在于磁盘,但在添加到项目的、和条目之前,Xcode无法识别它们。
project.pbxprojApp.entitlementsGoogleService-Info.plistPBXBuildFilePBXFileReferencePBXGroup对于每个不属于搭建内容的自定义文件,指导用户在Xcode中执行以下一次性操作(SPM搭建的项目没有——直接打开):
App.xcworkspaceApp.xcodeproj- 打开项目:(或
npx cap open ios)。open ios/App/App.xcodeproj - 在Xcode项目导航器中,右键点击组,选择Add Files to "App"…。
App - 选择每个恢复的自定义文件(例如、
App.entitlements、自定义GoogleService-Info.plist文件)。.swift - 确保Copy items if needed已取消勾选,且目标已勾选。
App
对于文件,还需在中设置构建设置。在目标的和 块中应用以下差异模式:
App.entitlementsios/App/App.xcodeproj/project.pbxprojCODE_SIGN_ENTITLEMENTSAppDebugReleaseXCBuildConfigurationdiff
CODE_SIGN_STYLE = Automatic;
+ CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CURRENT_PROJECT_VERSION = 1;若项目包含其他Xcode目标(例如下的通知服务扩展),用户必须在Xcode中重新创建这些目标。SPM搭建不会重新生成非目标。需明确告知用户。
ios/App/NotificationService/AppStep 11: Reconfigure Capabilities
步骤11:重新配置功能
For each capability key recorded from in Step 5, verify the corresponding capability is enabled in Xcode:
App.entitlements- Open via
ios/App/App.xcodeproj.npx cap open ios - Select the target → Signing & Capabilities tab.
App - For each entitlement key, add the matching capability via the + Capability button:
- → Push Notifications
aps-environment - → App Groups
com.apple.security.application-groups - → Associated Domains
com.apple.developer.associated-domains - → Keychain Sharing
keychain-access-groups - → Apple Pay
com.apple.developer.in-app-payments - → iCloud
com.apple.developer.icloud-services
This is the only step that requires Xcode interaction. Inform the user explicitly that this step must be done manually.
对于步骤5中从记录的每个功能键,验证Xcode中是否已启用相应功能:
App.entitlements- 通过打开
npx cap open ios。ios/App/App.xcodeproj - 选择目标 → Signing & Capabilities标签页。
App - 对于每个权限键,通过**+ Capability**按钮添加匹配的功能:
- → Push Notifications
aps-environment - → App Groups
com.apple.security.application-groups - → Associated Domains
com.apple.developer.associated-domains - → Keychain Sharing
keychain-access-groups - → Apple Pay
com.apple.developer.in-app-payments - → iCloud
com.apple.developer.icloud-services
这是唯一需要Xcode交互的步骤。需明确告知用户此步骤必须手动完成。
Step 12: Re-sync Plugins
步骤12:重新同步插件
Run:
bash
npm install
npx cap sync iosnpx cap sync iosios/App/CapApp-SPM/Package.swiftIf a plugin is reported as incompatible with SPM, inform the user. The user must either:
- Wait for upstream SPM support from the plugin maintainer, or
- Fork the plugin and add SPM support using the skill, or
capacitor-plugin-spm-support - Remove the plugin from the project.
运行:
bash
npm install
npx cap sync iosnpx cap sync iosios/App/CapApp-SPM/Package.swift若插件被报告为与SPM不兼容,告知用户。用户需选择以下操作之一:
- 等待插件维护者提供上游SPM支持,或
- Fork该插件并使用技能添加SPM支持,或
capacitor-plugin-spm-support - 从项目中移除该插件。
Step 13: Verify the Build
步骤13:验证构建
-
Open the project in Xcode and resolve SPM packages:bash
npx cap open iosIn Xcode, File → Packages → Resolve Package Versions (or wait for automatic resolution on open). -
Build for a simulator from the command line to confirm everything compiles:bash
npx cap run ios -
Verify the app launches and that previously working features (push notifications, deep links, Firebase, etc.) still function.
-
在Xcode中打开项目并解析SPM包:bash
npx cap open ios在Xcode中,选择File → Packages → Resolve Package Versions(或等待打开时自动解析)。 -
从命令行针对模拟器构建,确认所有内容均可编译:bash
npx cap run ios -
验证应用可启动,且之前正常工作的功能(推送通知、深度链接、Firebase等)仍能正常运行。
Step 14: Cleanup
步骤14:清理
Once the build is verified and the app runs correctly:
-
Delete the backup directory:bash
rm -rf .spm-migration-backup -
Remove theentry from
.spm-migration-backup/..gitignore -
Verify no CocoaPods artifacts remain:bash
find ios -name 'Podfile*' -o -name 'Pods' -o -name '*.xcworkspace'If any results appear, delete them. The SPM workflow usesdirectly — there is noApp.xcodeproj.App.xcworkspace -
Commit the migration:bash
git add -A git commit -m "chore(ios): migrate from CocoaPods to Swift Package Manager"
确认构建成功且应用正常运行后:
-
删除备份目录:bash
rm -rf .spm-migration-backup -
从中移除
.gitignore条目。.spm-migration-backup/ -
验证无CocoaPods残留文件:bash
find ios -name 'Podfile*' -o -name 'Pods' -o -name '*.xcworkspace'若有结果,删除它们。SPM工作流直接使用——不存在App.xcodeproj。App.xcworkspace -
提交迁移更改:bash
git add -A git commit -m "chore(ios): migrate from CocoaPods to Swift Package Manager"
Error Handling
错误处理
- fails with "ios platform already exists" — Step 6 was not completed. Re-run
npx cap add ios --packagemanager SPMand retry.rm -rf ios - reports a plugin without SPM support — that plugin cannot be used under SPM until it ships a
npx cap sync ios. Inform the user and pause the migration; do not silently drop the plugin.Package.swift - Build fails with "Module 'X' not found" — the plugin's SPM package was not resolved. Run File → Packages → Reset Package Caches in Xcode, then File → Packages → Resolve Package Versions.
- Build fails with code signing errors — the values reapplied in Step 9 are missing or incorrect. Re-read and confirm
.spm-migration-backup/ios/App/App.xcodeproj/project.pbxprojandDEVELOPMENT_TEAMwere applied to bothPRODUCT_BUNDLE_IDENTIFIERandDebugconfigurations.Release - Push notifications stop working after migration — the Push Notifications capability was not re-added in Step 11, or is not linked via
App.entitlements(Step 10).CODE_SIGN_ENTITLEMENTS - Firebase initializes but no data appears — was restored to disk but not added to the Xcode project's target membership in Step 10.
GoogleService-Info.plist - Custom Notification Service Extension target is missing — non-targets are not regenerated by
App. Recreate the target manually in Xcode and re-add its source files.npx cap add ios - The user reports they want to revert — because Step 1 verified a clean working tree, the entire migration can be undone with followed by
git checkout -- ..git clean -fd ios .spm-migration-backup
- 失败,提示"ios platform already exists" —— 步骤6未完成。重新运行
npx cap add ios --packagemanager SPM后重试。rm -rf ios - 报告插件不支持SPM —— 该插件在提供
npx cap sync ios前无法在SPM下使用。告知用户并暂停迁移;请勿静默移除插件。Package.swift - 构建失败,提示"Module 'X' not found" —— 插件的SPM包未解析。在Xcode中选择File → Packages → Reset Package Caches,然后选择File → Packages → Resolve Package Versions。
- 构建失败,出现签名错误 —— 步骤9中重新应用的值缺失或不正确。重新读取,确认
.spm-migration-backup/ios/App/App.xcodeproj/project.pbxproj和DEVELOPMENT_TEAM已应用到Debug和Release两种配置。PRODUCT_BUNDLE_IDENTIFIER - 迁移后推送通知停止工作 —— 步骤11中未重新添加Push Notifications功能,或未通过链接
CODE_SIGN_ENTITLEMENTS(步骤10)。App.entitlements - Firebase初始化但无数据显示 —— 已恢复到磁盘,但未在步骤10中添加到Xcode项目的目标成员。
GoogleService-Info.plist - 自定义通知服务扩展目标缺失 —— 不会重新生成非
npx cap add ios目标。在Xcode中手动重新创建目标并重新添加其源文件。App - 用户希望回滚 —— 由于步骤1已验证工作树干净,可通过撤销整个迁移。
git checkout -- . && git clean -fd ios .spm-migration-backup
Related Skills
相关技能
- — For adding SPM support to a Capacitor plugin (not an app). Use this if Step 12 reports a plugin without SPM support and the user controls that plugin's source.
capacitor-plugin-spm-support - — For installing or reconfiguring Capacitor plugins after the migration.
capacitor-plugins - — If the project is on Capacitor 5 or earlier, upgrade it to Capacitor 6+ first using this skill, then return here.
capacitor-app-upgrades - — For general Capacitor app development topics, troubleshooting, and best practices after the migration.
capacitor-app-development
- —— 用于为Capacitor 插件(而非应用)添加SPM支持。若步骤12报告插件不支持SPM且用户控制该插件源码,可使用此技能。
capacitor-plugin-spm-support - —— 用于迁移后安装或重新配置Capacitor插件。
capacitor-plugins - —— 若项目使用Capacitor 5或更早版本,先使用此技能升级到Capacitor 6+,再返回此处进行迁移。
capacitor-app-upgrades - —— 用于迁移后的Capacitor应用开发相关主题、故障排除和最佳实践。
capacitor-app-development