Repository navigation
Conversation
`setup-apple-spm add --deintegrate` ran `pod deintegrate` and failed when the `pod` tool was not on PATH. A new app's template project carries CocoaPods references, so converting it to Swift Package Manager failed on a Mac without CocoaPods. When `pod` is missing, the script now removes the CocoaPods references from project.pbxproj itself: the [CP] build phases, the Pods library and xcconfig references, and the empty Pods group. For the template and helloworld projects the result is byte-identical to `pod deintegrate`. It deletes no files on disk. If references remain that it does not know (such as the CocoaPods 1.16 anchor form), it changes nothing and exits with advice to install CocoaPods or remove them by hand. When `pod` is installed, `pod deintegrate` runs as before. Verify: `yarn test packages/react-native/scripts/spm` passes 1275 of 1275 tests.
chrfalch
marked this pull request as draft
December 1, 2026 07:41
chrfalch
marked this pull request as ready for review
December 1, 2026 08:43
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
setup-apple-spm add --deintegrateconverts an iOS app from CocoaPods to Swift Package Manager. It ranpod deintegrate, so it failed on a Mac without thepodtool. A new app's template project contains CocoaPods references, and plainaddrefuses such a project. So converting a new app to Swift Package Manager required CocoaPods to be installed.With this change, when
podis not installed, the script removes the CocoaPods references fromproject.pbxprojitself:[CP]build phases,Pods-*.xcconfigreferences,It deletes no files on disk. When
podis installed,pod deintegrateruns as before.If references remain that the script does not recognise, it changes nothing and exits with an error. One example is the newer CocoaPods 1.16
baseConfigurationReferenceAnchorform. The error says to install CocoaPods and run the command again, or to remove the remaining references by hand. The help text and the docs now say that CocoaPods is used when installed and is not required.Code:
removeCocoaPodsIntegrationinpackages/react-native/scripts/spm/spm-pbxproj.js. It is used byrunDeintegrateinpackages/react-native/scripts/setup-apple-spm.js. The test fixture__tests__/__fixtures__/cocoapods-app.pbxprojis a CocoaPods-integrated project with two targets.Changelog:
[IOS] [ADDED] -
spm add --deintegrateworks without CocoaPods installedTest Plan:
yarn test packages/react-native/scripts/spm: 25 of 25 suites and 1275 of 1275 tests passed. The new tests failed before the change.yarn flow-check: 0 errors.yarn eslint --max-warnings 0on the changed files: clean.private/helloworldand the community template project, the new function's output is byte-identical to the output ofbundle exec pod deintegrate(CocoaPods 1.14.2) followed by the existing empty-Pods-group cleanup.podon PATH:private/helloworldwas converted withspm add --deintegrate, as.github/workflows/test-ios-spm-newapp.ymldoes.xcodebuild(Debug, generic iOS Simulator) then printed BUILD SUCCEEDED.