Skip to content

Commit cd8064b

Browse files
fsonfacebook-github-bot
authored andcommitted
Add CocoaPods Podfile to the project template (#23563)
Summary: CocoaPods makes it easier to add new iOS dependencies to a project without having to manually edit Xcode projects. Editing Xcode projects is time consuming and merging changes to them difficult. Automating the changes to Xcode project `react-native link` is error prone. CocoaPods is a de-facto standard way to manage iOS dependencies and a central part of unimodules and upcoming improvements to `react-native link`. This PR adds a `Podfile` to the default project template of React Native. To use a project with CocoaPods, after creating it, run `cd ios; pod install` and use the created `<projectname>.xcworkspace` file instead of the `.xcodeproj` file. (We could make this a part of `react-native init` so you only need to run one command when creating a project.) [iOS] [Added] - Add CocoaPods Podfile to the project template Pull Request resolved: #23563 Differential Revision: D14576505 Pulled By: cpojer fbshipit-source-id: f6c9e93d61a52ad445d2931ccc4933d559a6ec1a
1 parent 27e7279 commit cd8064b

File tree

5 files changed

+102
-766
lines changed

5 files changed

+102
-766
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ package-lock.json
6969
# ReactCommon subdir shouldn't have Xcode project
7070
/ReactCommon/**/*.xcodeproj
7171
RNTester/build
72+
73+
# CocoaPods
74+
/template/ios/Pods/
75+
/template/ios/Podfile.lock

scripts/run-ci-e2e-tests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ try {
187187
'response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.bundle?platform=ios&dev=true)',
188188
);
189189
echo(`Starting packager server, ${SERVER_PID}`);
190+
echo('Running pod install');
191+
exec('pod install');
190192
echo('Executing ' + iosTestType + ' end-to-end test');
191193
if (
192194
tryExecNTimes(() => {
@@ -204,6 +206,8 @@ try {
204206
return exec(
205207
[
206208
'xcodebuild',
209+
'-workspace',
210+
'"EndToEndTest.xcworkspace"',
207211
'-destination',
208212
`"${destination}"`,
209213
'-scheme',

template/_gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ buck-out/
5454

5555
# Bundle artifact
5656
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/

0 commit comments

Comments
 (0)