You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains scripts for prebuilding React Native itself into XCFrameworks for iOS and related platforms.
3
+
This directory contains scripts for prebuilding React Native itself into
4
+
XCFrameworks for iOS and related platforms.
4
5
5
6
## Overview
6
7
7
-
These scripts automate the process of building React Native as a Swift Package and packaging it into XCFrameworks that can be distributed and consumed by iOS applications. The build process creates optimized frameworks for multiple architectures and platforms.
8
+
These scripts automate the process of building React Native as a Swift Package
9
+
and packaging it into XCFrameworks that can be distributed and consumed by iOS
10
+
applications. The build process creates optimized frameworks for multiple
11
+
architectures and platforms.
8
12
9
13
## Purpose
10
14
11
15
The prebuild scripts are used to:
12
16
13
17
- Build React Native itself (not its dependencies) as XCFrameworks
14
-
- Create distributable binaries for iOS, iOS Simulator, Catalyst, Vision, and visionOS platforms
18
+
- Create distributable binaries for iOS, iOS Simulator, Catalyst, Vision, and
19
+
visionOS platforms
15
20
- Support both Debug and Release build configurations
16
21
- Generate Debug Symbol (dSYM) files for debugging
17
22
- Enable library evolution and module stability for Swift packages
18
23
24
+
## Usage
25
+
26
+
Run the prebuild script from the command line:
27
+
28
+
```bash
29
+
cd packages/react-native
30
+
node scripts/ios-prebuild
31
+
```
32
+
33
+
If no options are passed, the script executes all the steps in this order:
verification (useful for React Native modules due to the header structure not
106
+
beeing modular)
97
107
98
108
## Notes
99
109
@@ -104,21 +114,24 @@ The build process uses specific `xcodebuild` flags:
104
114
105
115
## Known Issues
106
116
107
-
The generated XCFrameworks currently use CocoaPods-style header structures rather than standard framework header conventions. This may cause modularity issues when:
117
+
The generated XCFrameworks currently use CocoaPods-style header structures
118
+
rather than standard framework header conventions. This may cause modularity
119
+
issues when:
108
120
109
121
- Consuming the XCFrameworks in projects that expect standard framework headers
110
122
- Building dependent frameworks that rely on proper module boundaries
111
123
- Integrating with Swift Package Manager projects expecting modular headers
112
124
113
-
## Usage
114
-
115
-
To use the prebuilt React Native dependencies XCFrameworks in your iOS project, run pod install with the environment variable `RCT_USE_RN_DEP` set to `1`:
116
-
117
-
```bash
118
-
RCT_USE_RN_DEP=1 bundle exec pod install
119
-
```
125
+
## Integrating in your project with Cocoapods
120
126
121
-
For debugging and troubleshooting the Cocoapods scripts, you can use the following environment variables:
127
+
For consuming, debugging or troubleshooting when using Cocoapods scripts, you
128
+
can use the following environment variables:
122
129
123
-
-`RCT_USE_LOCAL_RN_DEP`: **TEST ONLY** If set, it will use a local tarball of ReactNativeDependencies if it exists.
124
-
-`RCT_DEPS_VERSION`: **TEST ONLY** If set, it will override the version of ReactNativeDependencies to be used.
130
+
-`RCT_USE_PREBUILT_RNCORE`: If set to 1, it will use the release tarball from
131
+
Maven instead of building from source.
132
+
-`RCT_TESTONLY_RNCORE_TARBALL_PATH`: **TEST ONLY** If set, it will use a local
133
+
tarball of RNCore if it exists.
134
+
-`RCT_TESTONLY_RNCORE_VERSION`: **TEST ONLY** If set, it will override the
135
+
version of RNCore to be used.
136
+
-`RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS`: If set to 1, it will download the dSYMs
137
+
for the prebuilt RNCore frameworks and install these in the framework folders
0 commit comments