1 | # @react-native-community/cli-platform-ios
|
2 |
|
3 | This package is part of the [React Native CLI](../../README.md). It contains commands for managing iOS part of React Native app.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```sh
|
8 | yarn add @react-native-community/cli-platform-ios
|
9 | ```
|
10 |
|
11 | ## Commands
|
12 |
|
13 | ### `run-ios`
|
14 |
|
15 | Usage:
|
16 |
|
17 | ```sh
|
18 | react-native run-ios [options]
|
19 | ```
|
20 |
|
21 | Builds your app and starts it on iOS simulator.
|
22 |
|
23 | #### Options
|
24 |
|
25 | #### `--simulator <simulator_name>`
|
26 |
|
27 | > default: iPhone 14
|
28 |
|
29 | Explicitly set the simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version, e.g. `"iPhone 6 (10.0)"`.
|
30 |
|
31 | Notes: If selected simulator does not exist, cli will try to run fallback simulators in following order:
|
32 |
|
33 | - `iPhone 14`
|
34 | - `iPhone 13`
|
35 | - `iPhone 12`
|
36 | - `iPhone 11`
|
37 |
|
38 | Notes: `simulator_name` must be a valid iOS simulator name. If in doubt, open your AwesomeApp/ios/AwesomeApp.xcodeproj folder on XCode and unroll the dropdown menu containing the simulator list. The dropdown menu is situated on the right hand side of the play button (top left corner).
|
39 |
|
40 | Example: this will launch your project directly onto the iPhone 14 simulator:
|
41 |
|
42 | ```sh
|
43 | react-native run-ios --simulator "iPhone 14"
|
44 | ```
|
45 |
|
46 | #### `--configuration <string>`
|
47 |
|
48 | [Deprecated] Explicitly set the scheme configuration to use default: 'Debug'.
|
49 |
|
50 | #### `--mode <string>`
|
51 |
|
52 | Explicitly set the scheme configuration to use. This option is case sensitive.
|
53 |
|
54 | Example:
|
55 |
|
56 | ```sh
|
57 | react-native run-ios --mode "Release"
|
58 | ```
|
59 |
|
60 | #### `--scheme <string>`
|
61 |
|
62 | Explicitly set Xcode scheme to use.
|
63 |
|
64 | #### `--device [string]`
|
65 |
|
66 | Explicitly set device to use by name. The value is not required if you have a single device connected.
|
67 |
|
68 | #### `--destination <string>`
|
69 |
|
70 | Explicitly extend distination e.g. "arch=x86_64"
|
71 |
|
72 | #### `--udid <string>`
|
73 |
|
74 | Explicitly set device to use by udid.
|
75 |
|
76 | #### `--no-packager`
|
77 |
|
78 | Do not launch packager while building.
|
79 |
|
80 | #### `--verbose`
|
81 |
|
82 | Do not use `xcbeautify` or `xcpretty` even if installed.
|
83 |
|
84 | #### `--port <number>`
|
85 |
|
86 | Runs packager on specified port.
|
87 |
|
88 | Default: `process.env.RCT_METRO_PORT || 8081`
|
89 |
|
90 | #### `--xcconfig <string>`
|
91 |
|
92 | Explicitly set `xcconfig` to use in build.
|
93 |
|
94 | #### `--buildFolder <string>`
|
95 |
|
96 | Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
|
97 |
|
98 | #### `--extra-params <string>`
|
99 |
|
100 | Custom params that will be passed to `xcodebuild` command.
|
101 | Example:
|
102 |
|
103 | ```sh
|
104 | react-native run-ios --extra-params "-jobs 4"
|
105 | ```
|
106 |
|
107 | ### `build-ios`
|
108 |
|
109 | Usage:
|
110 |
|
111 | ```sh
|
112 | react-native build-ios [options]
|
113 | ```
|
114 |
|
115 | Builds IOS app.
|
116 |
|
117 | #### Options
|
118 |
|
119 | #### `--simulator <simulator_name>`
|
120 |
|
121 | > default: iPhone 14
|
122 |
|
123 | Explicitly set the simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version, e.g. `"iPhone 6 (10.0)"`.
|
124 |
|
125 | Notes: If selected simulator does not exist, cli will try to run fallback simulators in following order:
|
126 |
|
127 | - `iPhone 14`
|
128 | - `iPhone 13`
|
129 | - `iPhone 12`
|
130 | - `iPhone 11`
|
131 |
|
132 | Notes: `simulator_name` must be a valid iOS simulator name. If in doubt, open your AwesomeApp/ios/AwesomeApp.xcodeproj folder on XCode and unroll the dropdown menu containing the simulator list. The dropdown menu is situated on the right hand side of the play button (top left corner).
|
133 |
|
134 | Example: this will launch your project directly onto the iPhone 14 simulator:
|
135 |
|
136 | ```sh
|
137 | react-native build-ios --simulator "iPhone 14"
|
138 | ```
|
139 |
|
140 | #### `--configuration <string>`
|
141 |
|
142 | [Deprecated] Explicitly set the scheme configuration to use default: 'Debug'.
|
143 |
|
144 | #### `--mode <string>`
|
145 |
|
146 | Explicitly set the scheme configuration to use. This option is case sensitive.
|
147 |
|
148 | Example:
|
149 |
|
150 | ```sh
|
151 | react-native build-ios --mode "Release"
|
152 | ```
|
153 |
|
154 | #### `--scheme <string>`
|
155 |
|
156 | Explicitly set Xcode scheme to use.
|
157 |
|
158 | #### `--device [string]`
|
159 |
|
160 | Explicitly set device to use by name. The value is not required if you have a single device connected.
|
161 |
|
162 | #### `--udid <string>`
|
163 |
|
164 | Explicitly set device to use by udid.
|
165 |
|
166 | #### `--no-packager`
|
167 |
|
168 | Do not launch packager while building.
|
169 |
|
170 | #### `--verbose`
|
171 |
|
172 | Do not use `xcbeautify` or `xcpretty` even if installed.
|
173 |
|
174 | #### `--port <number>`
|
175 |
|
176 | Runs packager on specified port.
|
177 |
|
178 | Default: `process.env.RCT_METRO_PORT || 8081`
|
179 |
|
180 | #### `--xcconfig <string>`
|
181 |
|
182 | Explicitly pass `xcconfig` options from the command line.
|
183 |
|
184 | #### `--buildFolder <string>`
|
185 |
|
186 | Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
|
187 |
|
188 | #### `--binary-path <path>`
|
189 |
|
190 | Installs passed binary instead of building a fresh one.
|
191 |
|
192 | #### `--list-devices`
|
193 |
|
194 | > default: false
|
195 |
|
196 | List all available iOS devices and simulators and let you choose one to run the app.
|
197 |
|
198 | #### `--extra-params <string>`
|
199 |
|
200 | Custom params that will be passed to `xcodebuild` command.
|
201 | Example:
|
202 |
|
203 | ```sh
|
204 | react-native build-ios --extra-params "-jobs 4"
|
205 | ```
|
206 |
|
207 | ### log-ios
|
208 |
|
209 | ### `log-ios`
|
210 |
|
211 | Usage:
|
212 |
|
213 | ```sh
|
214 | react-native log-ios
|
215 | ```
|
216 |
|
217 | Starts iOS device syslog tail.
|
218 |
|
219 | #### Options
|
220 |
|
221 | #### `--interactive`
|
222 |
|
223 | Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator.
|
224 |
|
225 | ## License
|
226 |
|
227 | Everything inside this repository is [MIT licensed](./LICENSE).
|