The run command allows you to compile your app locally.

project.json:

{ "name": "mobile", //... "targets": { //... "run-ios": { "executor": "@nx/expo:run", "options": { "platform": "ios" } }, "run-android": { "executor": "@nx/expo:run", "options": { "platform": "android" } } //... } }
Nx 15 and lower use @nrwl/ instead of @nx/

nx run mobile:run-ios nx run mobile:run-android

Examples

The variant option allows you to specify the compile Android app with variants defined in build.gradle file (e.g. debug, release).

"run-android": { "executor": "@nx/expo:run", "options": { "platform": "android", "variant": "release" } }
Nx 15 and lower use @nrwl/ instead of @nx/

Options

platform

pRequired
string
Default: ios
Accepted values: ios, android

Platform to run for (ios, android).

variant

string
Default: debug

(Android) Specify your app's build variant (e.g. debug, release).

xcodeConfiguration

string
Default: Debug

(iOS) Xcode configuration to use. Debug or Release

bundler

boolean

Whether to skip starting the Metro bundler. True to start it, false to skip it.

buildCache

boolean

Should use derived data for builds.

clean

boolean
Default: false

Delete the native folders and regenerate them before applying changes

device

d
string

Device name or UDID to build the app on. The value is not required if you have a single device connected.

install

boolean
Default: true

Installing npm packages and CocoaPods before building.

port

p
number
Default: 8081

Port to start the Metro bundler on

scheme

string

(iOS) Explicitly set the Xcode scheme to use

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