File tree 4 files changed +33
-4
lines changed
cli-platform-apple/src/commands
4 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type BuildFlags = {
12
12
destination ?: string ;
13
13
extraParams ?: string [ ] ;
14
14
forcePods ?: boolean ;
15
+ onlyPods ?: boolean ;
15
16
} ;
16
17
17
18
export const getBuildOptions = ( { platformName} : BuilderCommand ) => {
@@ -62,6 +63,10 @@ export const getBuildOptions = ({platformName}: BuilderCommand) => {
62
63
name : '--force-pods' ,
63
64
description : 'Force CocoaPods installation' ,
64
65
} ,
66
+ {
67
+ name : '--only-pods' ,
68
+ description : 'Only install Cocoapods, do not build the app' ,
69
+ } ,
65
70
! isMac && {
66
71
name : '--device [string]' , // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices
67
72
description :
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ const createBuild =
24
24
}
25
25
26
26
let installedPods = false ;
27
- if ( platformConfig . automaticPodsInstallation || args . forcePods ) {
27
+ if (
28
+ platformConfig . automaticPodsInstallation ||
29
+ args . forcePods ||
30
+ args . onlyPods
31
+ ) {
28
32
const isAppRunningNewArchitecture = platformConfig . sourceDir
29
33
? await getArchitecture ( platformConfig . sourceDir )
30
34
: undefined ;
@@ -36,14 +40,18 @@ const createBuild =
36
40
platformName ,
37
41
ctx . reactNativePath ,
38
42
{
39
- forceInstall : args . forcePods ,
43
+ forceInstall : args . forcePods || args . onlyPods ,
40
44
newArchEnabled : isAppRunningNewArchitecture ,
41
45
} ,
42
46
) ;
43
47
44
48
installedPods = true ;
45
49
}
46
50
51
+ if ( args . onlyPods ) {
52
+ return ;
53
+ }
54
+
47
55
let { xcodeProject, sourceDir} = getXcodeProjectAndDir (
48
56
platformConfig ,
49
57
platformName ,
Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ const createRun =
79
79
let { packager, port} = args ;
80
80
let installedPods = false ;
81
81
// check if pods need to be installed
82
- if ( platformConfig . automaticPodsInstallation || args . forcePods ) {
82
+ if (
83
+ platformConfig . automaticPodsInstallation ||
84
+ args . forcePods ||
85
+ args . onlyPods
86
+ ) {
83
87
const isAppRunningNewArchitecture = platformConfig . sourceDir
84
88
? await getArchitecture ( platformConfig . sourceDir )
85
89
: undefined ;
@@ -91,14 +95,18 @@ const createRun =
91
95
platformName ,
92
96
ctx . reactNativePath ,
93
97
{
94
- forceInstall : args . forcePods ,
98
+ forceInstall : args . forcePods || args . onlyPods ,
95
99
newArchEnabled : isAppRunningNewArchitecture ,
96
100
} ,
97
101
) ;
98
102
99
103
installedPods = true ;
100
104
}
101
105
106
+ if ( args . onlyPods ) {
107
+ return ;
108
+ }
109
+
102
110
if ( packager ) {
103
111
const { port : newPort , startPackager} = await findDevServerPort (
104
112
port ,
Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ List all available iOS devices and simulators and let you choose one to run the
118
118
119
119
Force running ` pod install ` before running an app
120
120
121
+ #### ` --only-pods ` ,
122
+
123
+ Only install Cocoapods, do not build the app.
124
+
121
125
### ` build-ios `
122
126
123
127
Usage:
@@ -177,6 +181,10 @@ npx react-native build-ios --extra-params "-jobs 4"
177
181
178
182
Force running ` pod install ` before building an app
179
183
184
+ #### ` --only-pods ` ,
185
+
186
+ Only install Cocoapods, do not build the app.
187
+
180
188
### ` log-ios `
181
189
182
190
Usage:
You can’t perform that action at this time.
0 commit comments