UNPKG

4.96 kBMarkdownView Raw
1# @react-native-community/cli-platform-ios
2
3This 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
8yarn add @react-native-community/cli-platform-ios
9```
10
11## Commands
12
13### `run-ios`
14
15Usage:
16
17```sh
18react-native run-ios [options]
19```
20
21Builds your app and starts it on iOS simulator.
22
23#### Options
24
25#### `--simulator <simulator_name>`
26
27> default: iPhone 14
28
29Explicitly 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
31Notes: 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
38Notes: `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
40Example: this will launch your project directly onto the iPhone 14 simulator:
41
42```sh
43react-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
52Explicitly set the scheme configuration to use. This option is case sensitive.
53
54Example:
55
56```sh
57react-native run-ios --mode "Release"
58```
59
60#### `--scheme <string>`
61
62Explicitly set Xcode scheme to use.
63
64#### `--device [string]`
65
66Explicitly set device to use by name. The value is not required if you have a single device connected.
67
68#### `--destination <string>`
69
70Explicitly extend distination e.g. "arch=x86_64"
71
72#### `--udid <string>`
73
74Explicitly set device to use by udid.
75
76#### `--no-packager`
77
78Do not launch packager while building.
79
80#### `--verbose`
81
82Do not use `xcbeautify` or `xcpretty` even if installed.
83
84#### `--port <number>`
85
86Runs packager on specified port.
87
88Default: `process.env.RCT_METRO_PORT || 8081`
89
90#### `--xcconfig <string>`
91
92Explicitly set `xcconfig` to use in build.
93
94#### `--buildFolder <string>`
95
96Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
97
98#### `--extra-params <string>`
99
100Custom params that will be passed to `xcodebuild` command.
101Example:
102
103```sh
104react-native run-ios --extra-params "-jobs 4"
105```
106
107### `build-ios`
108
109Usage:
110
111```sh
112react-native build-ios [options]
113```
114
115Builds IOS app.
116
117#### Options
118
119#### `--simulator <simulator_name>`
120
121> default: iPhone 14
122
123Explicitly 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
125Notes: 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
132Notes: `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
134Example: this will launch your project directly onto the iPhone 14 simulator:
135
136```sh
137react-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
146Explicitly set the scheme configuration to use. This option is case sensitive.
147
148Example:
149
150```sh
151react-native build-ios --mode "Release"
152```
153
154#### `--scheme <string>`
155
156Explicitly set Xcode scheme to use.
157
158#### `--device [string]`
159
160Explicitly set device to use by name. The value is not required if you have a single device connected.
161
162#### `--udid <string>`
163
164Explicitly set device to use by udid.
165
166#### `--no-packager`
167
168Do not launch packager while building.
169
170#### `--verbose`
171
172Do not use `xcbeautify` or `xcpretty` even if installed.
173
174#### `--port <number>`
175
176Runs packager on specified port.
177
178Default: `process.env.RCT_METRO_PORT || 8081`
179
180#### `--xcconfig <string>`
181
182Explicitly pass `xcconfig` options from the command line.
183
184#### `--buildFolder <string>`
185
186Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
187
188#### `--binary-path <path>`
189
190Installs passed binary instead of building a fresh one.
191
192#### `--list-devices`
193
194> default: false
195
196List all available iOS devices and simulators and let you choose one to run the app.
197
198#### `--extra-params <string>`
199
200Custom params that will be passed to `xcodebuild` command.
201Example:
202
203```sh
204react-native build-ios --extra-params "-jobs 4"
205```
206
207### log-ios
208
209### `log-ios`
210
211Usage:
212
213```sh
214react-native log-ios
215```
216
217Starts iOS device syslog tail.
218
219#### Options
220
221#### `--interactive`
222
223Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator.
224
225## License
226
227Everything inside this repository is [MIT licensed](./LICENSE).