Skip to content

Conversation

@kraenhansen
Copy link
Collaborator

@kraenhansen kraenhansen commented Feb 10, 2026

Fixes #262 and #213 by modifying the Xcode project after it has been generated by CocoaPods.

Merging this PR will:

  • Add a patch-xcode-project command to the host CLI: When called, it will modify the main Xcode app target to include a build phase which calls into the CLI with link --apple args.
  • Add an exit hook to the host package's podspec to conveniently run the patch-xcode-project command. Since users can run this commend themselves or we could drive it from a SPM project, I don't consider this a dependency on CocoaPods as such.
  • Modify the Apple link command to expect invocation from inside a build phase, to copy, renaming and signing frameworks (not xcframeworks) to their final destination in the app
    bundle, based on environment variables provided by Xcode.

Because the frameworks are no longer explicitly referenced by targets we also don't have the issue of the dynamic libraries being loaded at startup time. Which means faster boot times and less concern about the order of operations as they'll be loaded when required by the app.

@kraenhansen kraenhansen self-assigned this Feb 10, 2026
@kraenhansen kraenhansen added Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) Host 🏡 Our `react-native-node-api-modules` package Linking 🔗 Discovering and copying prebuilds from packages into the host MacOS 💻 Anything related to the Apple MacOS platform or React Native MacOS support labels Feb 10, 2026
@kraenhansen kraenhansen force-pushed the kh/apple-link-without-cocoapods branch from 06b03e4 to 7a4eacc Compare February 10, 2026 10:21
@kraenhansen kraenhansen linked an issue Feb 10, 2026 that may be closed by this pull request
@kraenhansen kraenhansen force-pushed the kh/apple-link-without-cocoapods branch from fc32743 to 6dc2cfb Compare February 10, 2026 12:47
@kraenhansen
Copy link
Collaborator Author

Tests on MacOS passing on this PR is currently blocked by #353.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) Host 🏡 Our `react-native-node-api-modules` package Linking 🔗 Discovering and copying prebuilds from packages into the host MacOS 💻 Anything related to the Apple MacOS platform or React Native MacOS support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Script phase to auto-link executes too late

1 participant