project.json:

1{ 2 "name": "mobile", 3 //... 4 "targets": { 5 //... 6 "build-ios": { 7 "executor": "@nx/react-native:build-ios", 8 "options": {} 9 } 10 } 11} 12
Nx 15 and lower use @nrwl/ instead of @nx/
1nx run mobile:build-ios 2

Examples

The buildFolder option allows to specify the location for ios build artifacts. It corresponds to Xcode's -derivedDataPath.

1 "build-ios": { 2 "executor": "@nx/react-native:build-ios", 3 "options": { 4 "buildFolder": "dist/ios/build" 5 } 6 } 7
Nx 15 and lower use @nrwl/ instead of @nx/
1nx build-ios <app-name> --buildFolder=dist/ios/build 2

Options

mode

string
Default: Debug

Explicitly set the scheme configuration to use

simulator

string

Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone 6 (10.0)"

buildFolder

string
Default: ./build

Location for iOS build artifacts. Corresponds to Xcode's "-derivedDataPath". Relative to ios directory

device

string

Explicitly set device to use by name. The value is not required if you have a single device connected.

extraParams

oneOf [Array<string>, string]

Custom params that will be passed to xcodebuild command.

interactive

boolean

Explicitly select which scheme and configuration to use before running a build

port

number
Default: 8081

The port where the packager server is listening on.

resetCache

boolean
Default: false

Resets metro cache.

scheme

string

Explicitly set Xcode scheme to use

udid

string

Explicitly set device to use by udid

verbose

boolean

Do not use xcbeautify or xcpretty even if installed

xcconfig

string

Explicitly set xcconfig to use

install

Deprecated
boolean
Default: true

Runs pod install for native modules before building iOS app.

Add pod-install to dependsOn in project.json for this target instead

packager

Deprecated
boolean
Default: true

Launch packager while building

Run nx run <project>:start instead. Will be removed in Nx 17.

sync

Deprecated
boolean
Default: true

Syncs npm dependencies to package.json (for React Native autolink).

Add sync-deps to dependsOn in project.json for this target instead